Hi,
I have a UserControlB which exposes a Title property of type string. I then have a UserControlA which contains one UserControlB and exposes a property called MyNestedControl which returns the instance of UserControlB.
In my main page I'm declaring a UserControlA and I'm trying to set the value of the Title property as follow MyNestedControl.Title="ABC".
However, Visual Studio throws a compile error saying that Title does not exist on the Type UserControlA.
Is this type of nesting possible through xaml? Please see below the full code.
Many thanks, Bruno
<UserControlB>
<TextBlock x:Name="txtBlock" />
</UserControlB>
public partial class UserControlB : UserControl {
public string Title
{
get { return this.txtBlock.Text; }
set { this.txtBlock.Text = value; }
}
}
<UserControlA>
<local:UserControlB x:Name="userControlB" />
</UserControlA>
public partial class UserControlA : UserControl {
public UserControlB MyNestedControl
{
get { return this.userControlB; }
}
}
<MainPage>
<local:UserControlA x:Name="userControlA" MyNestedControl.Title="ABC" />
</MainPage>