title: Align items in a stack panel?
body: <p>I was wondering if I can have 2 controls in a horizontal-oriented StackPanel so that the right item should be docked to the right side of the StackPanel.</p>
  
  <p>I tried the following but it didn't work:</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal"&gt;
      &lt;TextBlock&gt;Left&lt;/TextBlock&gt;
      &lt;Button Width="30" HorizontalAlignment="Right"&gt;Right&lt;Button&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>In the snippet above I want the Button to be docked to the right side of the StackPanel.</p>
  
  <p>Note: I need it to be done with StackPanel, not Grid etc.</p>