title: Absolute position element WPF
body: <p>I want to position a cross button in the top right of my dialog without it affecting the flow of the rest of the dialog, this seems to be rather difficult when commpared to CSS?</p>
  
  <p>This currently aligned the content about 20px from the right hand side because its still in column 0 and column 1 is occupying that space.  Ideally all the content would be within a <code>StackPanel</code> with the close button being positioned top right.  Failing that I guess it may be possible to make the content span the two columns? How do I fix this?</p>
  
  <p>Here is my current XAML:</p>
  
  <pre><code>&lt;Grid Margin="10"&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition/&gt;
          &lt;ColumnDefinition/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition/&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;StackPanel Grid.Row="0"&gt;
          &lt;TextBlock x:Name="UI_DialogTitle" Style="{StaticResource i2_TitleTextBlock}" Text="{TemplateBinding DialogTitle}" Visibility="{TemplateBinding DialogTitleVisibility}" Margin="0,0,0,10"/&gt;
          &lt;ContentPresenter x:Name="TheContentPresenter"/&gt;
      &lt;/StackPanel&gt;
  
      &lt;Button x:Name="UI_CloseDialog" Style="{StaticResource i2_CloseDialogButton}" Visibility="{TemplateBinding CloseButtonVisibility}" Grid.Column="1" Grid.Row="0"/&gt;
  &lt;/Grid&gt;     
  </code></pre>