1

I am newbie to Window mobile 8 development . I have page with 5 user controls and in one of the user control i want to set text of textbox which is present in some other user control, how can i do this . Is there a way where i can get list of the ui elements visible to user ?

Code_Life
  • 5,742
  • 4
  • 29
  • 49

2 Answers2

1

I am using visualTreeHelper to get list of all the elements present on screen ,irrespective of which user control they are present in .

        Panel theParent = VisualTreeHelper.GetParent(this) as Panel;
        theParent.FindName("Name of the element")
Code_Life
  • 5,742
  • 4
  • 29
  • 49
0

Hope you are using MVVM pattern .If yes , add a view model property for the text and bind this to the textbox .

Update this property whenever you want to change the value of the text box.

Use a visibility converter if you want to change the visibility also.

Community
  • 1
  • 1
Null Pointer
  • 9,089
  • 26
  • 73
  • 118