How to get the Elements defined under Control Template in runtime in WPF
A:
You can't do this!
only you can set some properties via Data-binding
. this is simple but also you can define user control and define dependency property
for setting properties from out sid.
If u need sample tell me!
Rev
2010-08-18 10:42:15
A:
use the Template Properties FindName method
Control.Template.FindName
Kishore Kumar
2010-08-18 10:46:50
+1
A:
You could probably use the VisualTreeHelper to find children. For example:
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parentElement); i++)
{
var childElement = VisualTreeHelper.GetChild(parentElement, i);
// Do something with object here
}
Rachel
2010-08-18 13:22:16