Padding via Style -> Setter does not apply
If you specify the element itself, then everything works
<TextBlock Style="{StaticResource expanderTextBlockStyle}" Padding="10 0" .... A lot of TextBlock elements, so I apply styles like this:
<Style x:Key="expanderTextBlockStyle"> <Setter Property="Control.Padding" Value="10 0"></Setter> <Setter Property="Control.FontWeight" Value="Normal"></Setter> <Setter Property="Control.FontSize" Value="14"></Setter> </Style> The FontSize and FontWeight properties work, but Padding does not!
Tell me what am I doing wrong?
Object--DispatcherObject--DependencyObject--Visual--UIElement--FrameworkElement--TextBlock- I do not see in the inheritance hierarchy of the Control class, why should it be used? - tym32167TextBlocknot aControlsuccessor. Specify in the style ofTargetType="TextBlock"and set the setter justProperty="Padding"- Andrey NOP