how can I select all children beside all strokes " I can select all strokes " and I want to select all children like textboxes and images I used Inkcanvas.Select(strokes)
for all strokes how can for children?
Asked
Active
Viewed 1,278 times
3 Answers
0
you can make it manual by
first :create List<UIElement> elementsToSelect = new List<UIElement>();
second :add every child in it
third : Inkcanvas.select(elementsToSelect)
you can see this link http://msdn.microsoft.com/en-us/library/aa972125%28VS.90%29.aspx

kartal
- 17,436
- 34
- 100
- 145
0
Just add something to the above solution, to add every child into the list, you can use class VisualTreeHelper and function GetChildrenCount and GetChild will be helpful.
From Athena Solution, Software Development in Singapore, http://www.athena-solution.com
0
List<UIElement> list = new List<UIElement>();
GetAllControl("someCanvas", list);
private void GetAllControl(Canvas c , List<UIElement> list)
{
foreach (Control control in c.Controls)
{
list.Add(control);
if (control.Controls.Count > 0)
GetAllControl(control , list);
}
}

hashi
- 2,520
- 3
- 22
- 25