title: How to put XAML right-align code into a style?
body: <p>It taking 5 lines to right-align a DataGridTextColumn is bloating my XAML.</p>
  
  <p><strong>How can I</strong> <strong>put this "right-align code block" into a style</strong> and call it from an attribute, e.g. class="rightAlignDataGridTextColumn".</p>
  
  <pre><code>&lt;toolkit:DataGridTextColumn Header="Order Date" Width="Auto"
         Binding="{Binding OrderDate, StringFormat='{}{0:dd.MM.yyyy}'}" 
         IsReadOnly="False"&gt;
      &lt;toolkit:DataGridTextColumn.ElementStyle&gt;
          &lt;Style TargetType="TextBlock"&gt;
              &lt;Setter Property="TextAlignment" Value="Right" /&gt;
          &lt;/Style&gt;
      &lt;/toolkit:DataGridTextColumn.ElementStyle&gt;
  &lt;/toolkit:DataGridTextColumn&gt;
  
  &lt;toolkit:DataGridTextColumn Header="Required Date" Width="Auto"
         Binding="{Binding RequiredDate, StringFormat='{}{0:dd.MM.yyyy}'}" 
         IsReadOnly="False"&gt;
      &lt;toolkit:DataGridTextColumn.ElementStyle&gt;
          &lt;Style TargetType="TextBlock"&gt;
              &lt;Setter Property="TextAlignment" Value="Right" /&gt;
          &lt;/Style&gt;
      &lt;/toolkit:DataGridTextColumn.ElementStyle&gt;
  &lt;/toolkit:DataGridTextColumn&gt;
  
  &lt;toolkit:DataGridTextColumn Header="Shipped Date" Width="Auto"
         Binding="{Binding ShippedDate, StringFormat='{}{0:dd.MM.yyyy}'}" 
         IsReadOnly="False"&gt;
      &lt;toolkit:DataGridTextColumn.ElementStyle&gt;
          &lt;Style TargetType="TextBlock"&gt;
              &lt;Setter Property="TextAlignment" Value="Right" /&gt;
          &lt;/Style&gt;
      &lt;/toolkit:DataGridTextColumn.ElementStyle&gt;
  &lt;/toolkit:DataGridTextColumn&gt;
  </code></pre>