WPF: distance between elements in a panel stack

I have a stack with checkboxes. I can not make the same distance between the flags with the margin property

Can someone tell me what I am doing wrong?

The code below gives me the following:

http://www.shrani.si/f/1Y/M6/4eniAdAw/margin.png http://www.shrani.si/f/1Y/M6/4eniAdAw/margin.png

As you can see, the distance between the elements is not constant!

<StackPanel MinWidth="150" cal:Bind.Model="{Binding}" Orientation="Horizontal">
    <StackPanel.Resources>
        <Style TargetType="{x:Type CheckBox}">
            <Setter Property="Margin" Value="0,0,20,0"/>
        </Style>
    </StackPanel.Resources>
    <CheckBox IsChecked="{Binding IsShown}" Content="{Binding ModuleName, Converter={StaticResource localizeModuleAndFunctionConverter}}" 
              cal:Message.Attach="[Event Click] = [Action FilterShownModuleFunctions]" />
</StackPanel>
+5
source share
1 answer

, - MinWidth = "150". , 5 . 4 , . , , 4 .

... , 150 (), 150, , ( 20).

MinWidth = "150", , 20 . ( , , , , , ).

+4

All Articles