Hi,
let's assume I've got a UserControl like this:
<UserControl x:Class="SomeNamespace.SomeClass">
<Grid>
<TextBlock Name="SampleTextBlock" />
</Grid>
</Usercontrol>
Somehwere in my application I get handed the Name: SampleTextBlock. I can find the corresponding Framework-Element to the name. But how can I find the Type of the Code-Behind class from that Framework-Element?
This is what I am looking for in the specified sample:
Type usercontrolTypeOfElement = typeof(SomeClass);
But how to get SomeClass from the Frameworkelement of the TextBlock named SampleTextBlock?