Forum Xamarin.Forms

Nested namespaces in XAML

KramarKramar USMember
edited October 2016 in Xamarin.Forms

So I have these 2 line in my xaml (at appropriate locations) to add a custom control to my pages.

    xmlns:local="clr-namespace:AProject;assembly=AProject"

    <local:Nested.AControl/>

Sometimes it works fine, but other times I get an error "Type Nested not found in xmlns clr-namespace:AProject;assembly=AProject" and I have to change it to

    xmlns:nested="clr-namespace:AProject.Nested;assembly=AProject"

    <nested:AControl/>

I can't figure out what causes the namespace to not be found. In fact, in one particular XAML I use two nested namespaces and one works with"local" but the other has to used "nested". Can someone shed any light on the reason this is happening?

Answers

Sign In or Register to comment.