public MainWindow() { InitializeComponent(); this.Title = ApplicationState.Version; ScreenController.Create(this); this.DataContext = ScreenController.Instance; this.MouseLeftButtonDown += new MouseButtonEventHandler(MainWindow_MouseLeftButtonDown); }
public MainWindow() { InitializeComponent(); this.Title = ApplicationState.Version; ScreenController.Create(this); this.DataContext = ScreenController.Instance; this.MouseLeftButtonDown += new MouseButtonEventHandler(MainWindow_MouseLeftButtonDown); Loaded += (o, e) => { // Hook the window procedure var source = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle); source.AddHook(new HwndSourceHook(WndProc)); }; initLayout(); }