title: Setting application level margin property
body: <p>We are trying to follow <a href="http://msdn.microsoft.com/en-us/library/aa511279.aspx#sizingspacing" rel="nofollow">these</a> guidelines.
  For this I want to set application level style or properties to set the margins between controls.</p>
  
  <p>I am not able to set the margins through style as it ask me for target object and there might be the cases when I don't want to follow the above.</p>
  
  <p>I am able to set the margin by making some getter properties in App.xaml.cs</p>
  
  <pre><code>   /// &lt;summary&gt;
      /// Gets the margin to be set all around the dialog
      /// &lt;/summary&gt;
      public Thickness MarginsAllAroundDialog
      {
        get
        {
          // returns default margin
          return new Thickness(7);
        }
      }
  </code></pre>
  
  <p>and setting the margin to the dialog as:</p>
  
  <pre><code>&lt;Window x:Class="XXX.Views.MainWindow"
          x:Name="mainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:prism="http://www.codeplex.com/prism"
          Title="MainWindow" 
          Margin="{Binding Path=MarginsAllAroundDialog, Source={x:Static Application.Current}}"
          Height="350" 
          Width="525"
          WindowState="Maximized"&gt;
  </code></pre>
  
  <p>Is this the correct way or we achieve the same by simpler means.</p>