public MainWindow() { InitializeComponent(); this.MouseMove += (sender, arg) => this._lastMousePosition = arg.GetPosition(this); MainLoop(); }