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 ?
Asked
Active
Viewed 321 times
2 Answers
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
-
May be add an explanation of "what you are doing" with your code? – Santhan Salai May 20 '15 at 05:45
-
This answer was exactly what I needed. – bsky Feb 15 '18 at 13:47
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