Issue
I have a problem with i am trying to use the xmls: views to connect my collectionsViews in contentTemplate
of my AppShellPage. but the problem is that I put them in sub folders of views. and it doesn't work he tells me that xmls: views is already
xmlns:views="clr-namespace:Appli.views.cat"
xmlns:views = "clr-namespace:Appli.views.dog"
BackgroundColor="Aqua">
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<Tab Title="Home"
Icon="paw1Png.png">
<ShellContent Title="Cats"
Icon="cat.png"
Route="CatsRoute"
ContentTemplate="{DataTemplate views:CatsPage}" />
<ShellContent Title="Dogs"
Icon="dog.png"
Route="DogsRoute"
ContentTemplate="{DataTemplate views:DogsPage}"
/>

Solution
You are defining the xaml namespace view 2 times while it must be unique,
the first definition is xmlns:views="clr-namespace:Appli.views.cat" and the second definition is xmlns:views = "clr-namespace:Appli.views.dog".
The sub folder where you are saving your class doesn't matter what matters is the namespace where the class is defined, What you can do is either to put CatsPage and DogsPage on the same namespace, let say Appli.views.AnimalPages:
CatsPage.cs
namespace Appli.views.AnimalPages {
public Class CatsPage { }
}
DogsPage.cs
namespace Appli.views.AnimalPages {
public Class DogsPage { }
}
Your xaml namespace becomes xmlns:views="clr-namespace:Appli.views.AnimalPages"
Answered By - Cfun
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.