Passing parameters in Silverlight Usercontrol
I have a usercontrol called MyUserControl.xaml which dynamically adds another user control:
UserControl myControl = (UserControl)assembly.CreateInstance ("EditControlPage"); myControl.Name = "MyUserControl";
Th开发者_如何学运维is is a shared Edit control which will be shown an several other controls aswell.
What i need is when I access the EditControlPage I know which control I am using. I tried adding the myControl.Name as above then when on the Edit page doing var name = this.Name but it returns blank.
Why not just do UserControl myControl = new EditControlPage(parameters); ?
This has been resolved by adding a Property in the App.xaml file of the project as this can be shared between all controls on the app
精彩评论