Find child controls in wpf
In wpf can traverse through VisualTree using VisualTreeHelper class to find the controls. Here is the example to find all the checkboxes inside a control using VisualTreeHelper class.
C# code (wpf)
——————————————–
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parentcontrol); i++)
{
var checkBox = VisualTreeHelper.GetChild(parentControl, i) as CheckBox;
if (checkBox != null)
{
// do task for the checkbox.
}
}






