public async void ShowPrompt_ClosingWithGameStillOpened(Action successAction) { await Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(async() => { var title = MainThread.FindResource("Dialog_CloseGame_Title") as string; var content = MainThread.FindResource("Dialog_CloseGame_Text") as string; var result = await DialogPrompt.ShowDialog_YesNoCancel(title, content); if (result == System.Windows.Forms.DialogResult.Yes) { LauncherModel.Default.GameManager.GameProcess.Kill(); AllowedToCloseWithGameOpen = true; if (successAction != null) { successAction.Invoke(); } } else if (result == System.Windows.Forms.DialogResult.No) { AllowedToCloseWithGameOpen = true; if (successAction != null) { successAction.Invoke(); } } else if (result == System.Windows.Forms.DialogResult.Cancel) { AllowedToCloseWithGameOpen = false; } })); }