title: WPF: Spacing between elements in stackpanel
body: <p>I have a stackpanel with checkboxes.
  I cant seem to make same spacing between checkboxes with margin property</p>
  
  <p>Can some1 tell me what am i doing wrong?</p>
  
  <p>The code below gives me this:</p>
  
  <p><a href="https://i.stack.imgur.com/rz9Ky.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rz9Ky.png" alt="http://www.shrani.si/f/1Y/M6/4eniAdAw/margin.png"></a><br>
  <sub>(source: <a href="http://www.shrani.si/f/1Y/M6/4eniAdAw/margin.png" rel="nofollow noreferrer">shrani.si</a>)</sub>  </p>
  
  <p>As you can see, the spacing between elements is not constant !</p>
  
  <pre><code>&lt;StackPanel MinWidth="150" cal:Bind.Model="{Binding}" Orientation="Horizontal"&gt;
      &lt;StackPanel.Resources&gt;
          &lt;Style TargetType="{x:Type CheckBox}"&gt;
              &lt;Setter Property="Margin" Value="0,0,20,0"/&gt;
          &lt;/Style&gt;
      &lt;/StackPanel.Resources&gt;
      &lt;CheckBox IsChecked="{Binding IsShown}" Content="{Binding ModuleName, Converter={StaticResource localizeModuleAndFunctionConverter}}" 
                cal:Message.Attach="[Event Click] = [Action FilterShownModuleFunctions]" /&gt;
  &lt;/StackPanel&gt;
  </code></pre>