If I have a Style inside Generic.xaml and I want to reference a style within the SAME Generic.xaml file why does it not work?
<Style TargetType="{x:Type w:SomeControlIWantToStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type w:SomeControlIWantToStyle}">
...
<TextBlock Text="{DynamicResource SomeStyle}" />
...
<Style x:Key="SomeStyle" ... />
I am unable to reference the "SomeStyle" from within the ControlTemplate!
Any ideas?
please put the
style on top of this style
just maintain the hierarchy. If you want to call the style just declare the style above the calling style.