How can I get a named resource from ControlTemplate in a code-behind file (*.xaml.cs)? TryFindResource returns null. Template property of the control is also null. What else should I try?
Thanks.
How can I get a named resource from ControlTemplate in a code-behind file (*.xaml.cs)?
Share
Are you using custom control?
If yes, you can override OnApplyTemplate method in custom control and can use
Template.Find("name of resource")then expose it as a property from the control.
if No, then use custom control.
Hope it helps!