private void EnableDynamic() { App.Current.Dispatcher.Invoke(() => { keyboardHook.StartHook(); mouseHook = new GlobalMouseHook(); mouseHook.DoubleClick += OnMouseDoubleClicked; SendKeys.Flush(); }); }