public void ShowEditHotKeysDialog(EditHotKeyDialogArgs dialogArgs)
        {
            var mainWindow = (Window)this.application.WindowManager.AllWindows[0];

            var showDialog = new Action(() =>
            {
                var viewModel = new HotKeyConfigurationViewModel();
                var window    = new HotKeyConfigurationWindow();

                EventHandler <RequestSaveEventArgs> requestSaveHandler = (sender, args) =>
                {
                    JavaScriptPluginCallback handler = HotKeysEdited;
                    if (handler != null)
                    {
                        handler(new object[] { args.isHotKeyEnabled, args.selectedModifier, args.keys });
                    }
                    window.Close();
                };
                EventHandler requestCloseHandler = (sender, args) => window.Close();

                viewModel.RequestSave  += requestSaveHandler;
                viewModel.RequestClose += requestCloseHandler;

                viewModel.IsHotKeyEnabled  = dialogArgs.IsEnabled;
                viewModel.SelectedModifier = (ModifierKeys)Enum.Parse(typeof(ModifierKeys), dialogArgs.Modifier);
                viewModel.Keys             = (Keys)Enum.Parse(typeof(Keys), dialogArgs.Key);

                window.DataContext = viewModel;
                window.Closing    += (sender, args) =>
                {
                    viewModel.RequestSave  -= requestSaveHandler;
                    viewModel.RequestClose -= requestCloseHandler;
                };

                window.Owner = mainWindow;
                window.ShowDialog();
            });

            if (!mainWindow.Dispatcher.CheckAccess())
            {
                mainWindow.Dispatcher.Invoke(showDialog);
            }
            else
            {
                showDialog.Invoke();
            }
        }
        private void CreateAndShowView()
        {
            var hotKeyWindow = new HotKeyConfigurationWindow();
            var viewModel    = new HotKeyConfigurationViewModel(this.settings, this.eventAggregator);

            EventHandler requestShowHandler = (sender, args) =>
            {
                hotKeyWindow.Owner = this.applicationWindow.Unwrap();
                hotKeyWindow.Show();
            };
            EventHandler requestCloseHandler = (sender, args) => hotKeyWindow.Close();

            viewModel.RequestClose += requestCloseHandler;
            viewModel.RequestShow  += requestShowHandler;

            hotKeyWindow.DataContext = viewModel;
            hotKeyWindow.Closing    += (sender, args) =>
            {
                viewModel.RequestClose -= requestCloseHandler;
                viewModel.RequestShow  -= requestShowHandler;
            };

            viewModel.Show();
        }