Acessing ChildWindow fields and UserControl fields

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
ATA
Posts: 4
Joined: Mon Nov 07, 2016 12:55 am

Acessing ChildWindow fields and UserControl fields

Postby ATA » Wed Nov 09, 2016 12:41 am

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

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Acessing ChildWindow fields and UserControl fields

Postby JS-Support @Userware » Wed Nov 09, 2016 7:40 am

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

ATA
Posts: 4
Joined: Mon Nov 07, 2016 12:55 am

Re: Acessing ChildWindow fields and UserControl fields

Postby ATA » Wed Nov 09, 2016 9:45 pm

Thanks Team :)


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 48 guests

 

 

cron