title: how to move a button in WPF
body: <p>XAML code is below</p>
  
  <pre><code>&lt;Window x:Class="DenemeWpfApplication1.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;DockPanel Width="Auto"
                     VerticalAlignment="Stretch"
                     Height="Auto"
                     HorizontalAlignment="Stretch"
                     Grid.ColumnSpan="1"
                     Grid.Column="0"
                     Grid.Row="0"
                     Margin="0,0,0,0"
                     Grid.RowSpan="1"&gt;
  
              &lt;StackPanel&gt;
                  &lt;StackPanel.Background&gt;
                      &lt;LinearGradientBrush&gt;
                          &lt;GradientStop Color="White" Offset="0" /&gt;
                          &lt;GradientStop Color="DarkKhaki" Offset=".3" /&gt;
                          &lt;GradientStop Color="DarkKhaki" Offset=".7" /&gt;
                          &lt;GradientStop Color="White" Offset="1" /&gt;
                      &lt;/LinearGradientBrush&gt;
                  &lt;/StackPanel.Background&gt;
                  &lt;StackPanel Margin="10"&gt;
                      &lt;Button Name="simpleButton"
                              Click="simpleButtonClick"
                              KeyDown="simpleButton_KeyDown"&gt;Simple&lt;/Button&gt;
                      &lt;Button Name="cubeButton"
                              Click="cubeButtonClick"&gt;Cube&lt;/Button&gt;
                  &lt;/StackPanel&gt;
              &lt;/StackPanel&gt;
              &lt;Viewport3D Name="mainViewport"
                          ClipToBounds="True"&gt;
                  &lt;Viewport3D.Camera&gt;
                      &lt;PerspectiveCamera FarPlaneDistance="100"
                                         LookDirection="-11,-10,-9"
                                         UpDirection="0,1,0"
                                         NearPlaneDistance="1"
                                         Position="11,10,9"
                                         FieldOfView="70" /&gt;
                  &lt;/Viewport3D.Camera&gt;
                  &lt;ModelVisual3D&gt;
                      &lt;ModelVisual3D.Content&gt;
                          &lt;DirectionalLight Color="White" Direction="-2,-3,-1" /&gt;
                      &lt;/ModelVisual3D.Content&gt;
                  &lt;/ModelVisual3D&gt;
              &lt;/Viewport3D&gt;
          &lt;/DockPanel&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>this is inide XAML.cs</p>
  
  <pre><code>private void simpleButton_KeyDown(object sender, KeyEventArgs e)
  {
      if (e.Key == Key.P) {
          //something to move the simpleButton
      }
  }
  </code></pre>
  
  <p>I want to move <code>simpleButton</code> when P is pressed from keyboard, but I can't seem to find any method or way to do that.</p>