title: WPF Align contextmenu to the right-bottom corner of the button
body: <p>I have a Button and a <code>ContextMenu</code> that belongs to the <code>Button</code>.<br/>
  Here is the xaml:</p>
  
  <pre><code>&lt;Button x:Name="ListBoxButton" Content="6" Style="{DynamicResource TabControlButton}"&gt;
      &lt;Button.ContextMenu&gt;
          &lt;ContextMenu&gt;
              &lt;MenuItem Header="tst1"&gt;&lt;/MenuItem&gt;
              &lt;MenuItem Header="tst2"&gt;&lt;/MenuItem&gt;
          &lt;/ContextMenu&gt;
      &lt;/Button.ContextMenu&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>I want to align my ContextMenu exactly the same place like image #2 <a href="https://stackoverflow.com/questions/5340640/wpf-combobox-popup-placement-bottom-and-aligned-to-the-right-edge">in this post</a><br/>
  <strong>I want to use xaml to achieve it instead of code-behind.</strong></p>
  
  <p>I couldnt achieve it, I tried to play with the <code>PlacementTarget</code>, <code>HorizontalOffset</code>, <code>VeritcalOffset</code> and <code>Placement</code> properties of the <code>ContextMenu</code> but it didnt aligned as I want..</p>