Wednesday, March 24, 2010

Moving a WPF Window with a WindowStyle of None

From: http://cloudstore.blogspot.com/2008/06/moving-wpf-window-with-windowstyle-of.html

To enable a user to move your window from any area on that window (not necessarily just the title if you want to do something really different), you simply handle the MouseLeftButtonDown event for a UIElement on your window and call the DragMove method, as shown in the following code example.

private void title_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}

No comments: