代码如下:
订阅需要拖拽的地方的MouseLeftButtonDown事件,判断当前鼠标状态再执行拖拽
private void UiWindow_MouseLeftButtonDown(object sender,MouseButtonEventArgs e)
{
if (Mouse.LeftButton == MouseButtonState.Pressed)
this.DragMove();
}