Page 1 of 1

Acessing ChildWindow fields and UserControl fields

Posted: Wed Nov 09, 2016 12:41 am
by ATA
Dear Team,

I have created a sample ChildWindow and was able to access the ChildWindow page from the Main.xaml page but was not to access the controls placed in the ChildWindow.

Would be great if there is an example for this.

Thanks,
ATA

Re: Acessing ChildWindow fields and UserControl fields

Posted: Wed Nov 09, 2016 7:40 am
by JS-Support @Userware
Hi,

You need to expose via public properties the elements that you want other classes to access. For example, if you have a XAML button that is named x:Name="mybutton", you should create the following property in your ChildWindow-derived class to enable other classes to access it:

Code: Select all

public Button MyButton
{
    get { return this.mybutton; }
}


You can see a ChildWindow example/documentation at the following URL:
http://forums.cshtml5.com/viewtopic.php?f=6&t=7489#p8211

Regards,
JS-Support

Re: Acessing ChildWindow fields and UserControl fields

Posted: Wed Nov 09, 2016 9:45 pm
by ATA
Thanks Team :)