tags:

views:

26

answers:

3

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
A: 

use the Template Properties FindName method

Control.Template.FindName

Kishore Kumar
+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