Assigning all StackPanel child element margin

I am trying to set the margin for all elements in stackpanel from resor. Can you point out why it's not working here?
XAML
<StackPanel.Resources>
<Style x:Name="marginSetter"
TargetType="{x:Type FrameworkElement}">
<Setter Property="Margin"
Value="{StaticResource tbMargin}" />
</Style>
</StackPanel.Resources>
XAML
<StackPanel.Resources>
<Style x:Name="marginSetter"
TargetType="{x:Type FrameworkElement}">
<Setter Property="Margin"
Value="{StaticResource tbMargin}" />
</Style>
</StackPanel.Resources>
1 Reply
i_know_things
i_know_thingsOP3y ago
or is there any alternative to achieve this? <Thickness x:Key="tbMargin">5,10</Thickness> added tbMargin Did you guys understand what I said in the question ?? Smadge
Want results from more Discord servers?
Add your server