Get the child controls based on Type

There are times when you have to get the child control;
Normally What I have to do is to iterate through the Children of the Parent Control and Check for the control, What if I want to get a specefic control; Say TextBox
All you have to do is create a list

List TextBoxCtrlUIElements = LayoutRoot.Children.Where(obj => obj.GetType().Name == "TextBox").ToList();


Now the list will be having the Children of Type TextBox in the LayoutRoot object.

Comments