C
C#

help

Assigning all StackPanel child element margin

Ii_know_things9/28/2022
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>
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

Looking for more? Join the community!