title: Dragging custom window title bar from top when maximized does not work
body: <p>I have a custom title bar and with the window style set to none.  On the click of the title bar I check to see if it is a double click (that does window maximize and restore) if it is not double clicked I do <code>Window.DragMove</code>. This works great for the snapping to the side and top.  But when I try to drag the window when it is maximized (which would normally restore the window down), it doesn't do anything.  Here is my code: </p>
  
  <pre><code>    static Window Window { get { return Application.Current.MainWindow; } }
  
      /// &lt;summary&gt;
      /// TitleBar_MouseDown - Drag if single-click, resize if double-click
      /// &lt;/summary&gt;
      private static void TitleBar_MouseDown(object sender, MouseButtonEventArgs e)
      {
          if (e.ChangedButton == MouseButton.Left)
          {
              if (e.ClickCount == 2)
              {
                  AdjustWindowSize();
              }
              else
              {
                  Window.DragMove();//Here is where I do the drag move
              }
          }
      }
  
      /// &lt;summary&gt;
      /// Adjusts the WindowSize to correct parameters when Maximize button is clicked
      /// &lt;/summary&gt;
      internal static void AdjustWindowSize()
      {
          if (Window.WindowState == WindowState.Maximized)
          {
              SystemCommands.RestoreWindow(Window);
          }
          else
          {
              SystemCommands.MaximizeWindow(Window);
          }
  
      }
  
      #region Button Events
  
      /// &lt;summary&gt;
      /// CloseButton_Clicked
      /// &lt;/summary&gt;
      public static void Close()
      {
          SystemCommands.CloseWindow(Window);
      }
  
      /// &lt;summary&gt;
      /// MaximizedButton_Clicked
      /// &lt;/summary&gt;
      public static void Maximize()
      {
          AdjustWindowSize();
      }
  
      /// &lt;summary&gt;
      /// Minimized Button_Clicked
      /// &lt;/summary&gt;
      public static void Minimize()
      {
          SystemCommands.MinimizeWindow(Window);
      }
  
      #endregion
  </code></pre>
  
  <p>Modern UI and MahApps.Metro does it somehow and I looked at their source code briefly but could not find how they do it.</p>
  
  <p>Thanks in advance.</p>