我动态创建了一个具有WindowStyle
设置为None
. 因此,我想通过覆盖其内容将其设置为DragMove-ableOnMouseLeftButtonDown
。
我不知道如何在SecondaryWindow初始化语句中包含覆盖函数
public class MainWindow
{
Window SecondaryWindow = new Window
{
WindowStyle = System.Windows.WindowStyle.None,
Content = new myUserControl(),
Topmost = true,
// My failed attempt
base.OnMouseLeftButtonDown += (object sender, MouseButtonEventArgs e) =>
{
base.OnMouseLeftButtonDown(e);
base.DragMove();
}
};
}