private void chkSearchByUrl_Checked(object sender, RoutedEventArgs e) { try { if (LDGlobals.listAccounts.Count>0) { var window = new ModernDialog { Content = new UserControlLISSearchByUrl() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } else { MessageBox.Show("Please upload the Accounts."); } } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private async void DeleteCompany_OnClick(object sender, RoutedEventArgs e) { if (_COMPANIES.SelectedItem == null) return; try { var card = ((CompanyCard)_COMPANIES.SelectedItem); var dialog = new ModernDialog { Title = "eStation", Content = "Ete vous sure de supprimer " + card.Name + " ?" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; if (await App.Store.Sales.Delete(card.CompanyGuid)) ModernDialog.ShowMessage("Supprimer avec Success !", "eStation", MessageBoxButton.OK); else ModernDialog.ShowMessage("Erreur Inconnue !", "eStation", MessageBoxButton.OK); } catch (Exception ex) { DebugHelper.WriteException(ex); ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } await Refresh(); e.Handled = true; }
private void chk_SalesNavigator_PremiumOption_Checked(object sender, RoutedEventArgs e) { try { if (chk_SalesNavigator_PremiumOption.IsChecked==true) { GlobalsScraper.chkPremiumOptionsSalesNav = true; var window = new ModernDialog { Content = new UserControl_SalesNaviagtor_PremiumOption() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } else { GlobalsScraper.chkPremiumOptionsSalesNav = false; } } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private async void Delete_OnClick(object sender, RoutedEventArgs e) { if (_STOCKS.SelectedItem == null) return; try { var card = ((OilDeliveryCard)_STOCKS.SelectedItem); var dialog = new ModernDialog { Title = "eStation", Content = "Ete vous sure de supprimer cette livraison de " + card.Supplier + " ?" }; if (dialog.ShowDialogOkCancel() != MessageBoxResult.OK) return; if (await App.Store.Oils.DeleteDelivery(card.OilDeliveryGuid)) ModernDialog.ShowMessage("Supprimer avec Success !", "eStation", MessageBoxButton.OK); else ModernDialog.ShowMessage("Erreur Inconnue !", "eStation", MessageBoxButton.OK); } catch (Exception ex) { DebugHelper.WriteException(ex); ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } await Refresh(_currentOils); e.Handled = true; }
private void Application_Startup(object sender, StartupEventArgs e) { if (!IsRunAsAdministrator()) { var processInfo = new ProcessStartInfo(Assembly.GetExecutingAssembly().CodeBase) { UseShellExecute = true, Verb = "runas" }; try { Process.Start(processInfo); } catch { var messageBox = new ModernDialog { Title = "Woops", Content = new ErrorDialog(new InvalidOperationException("Chocolatey Explorer must be run as an administrator.")) }; messageBox.ShowDialog(); } this.Shutdown(); } }
private void rdo_UsingPhotoId_ScrapeCommentmessage_Checked(object sender, RoutedEventArgs e) { try { UserControlScrapeCommentMessagebyPhotoId obj_UserControlScrapeCommentMessagebyPhotoId = new UserControlScrapeCommentMessagebyPhotoId(); var window = new ModernDialog { Content = obj_UserControlScrapeCommentMessagebyPhotoId }; window.MinHeight = 300; window.MinWidth = 700; // window.Topmost = true; Button customButton = new Button() { Content = "Save" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (sa, pa) => { SaveAllData(ref obj_UserControlScrapeCommentMessagebyPhotoId); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); string s1 = string.Empty; } catch(Exception ex) { GlobusLogHelper.log.Error("Error:" + ex.StackTrace); } }
private void CommonDialog_Click(object sender, RoutedEventArgs e) { var dlg = new ModernDialog { Title = "Common dialog", Content = new LoremIpsum() }; dlg.Buttons = new Button[] { dlg.OkButton, dlg.CancelButton}; dlg.ShowDialog(); this.dialogResult.Text = dlg.DialogResult.HasValue ? dlg.DialogResult.ToString() : "<null>"; this.dialogMessageBoxResult.Text = dlg.MessageBoxResult.ToString(); }
void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { var messageBox = new ModernDialog { Title = "Woops", Content = new ErrorDialog(e.Exception) }; messageBox.ShowDialog(); e.Handled = true; }
private void rdoBtn_HashTagsComment_SingleUser_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.HashComment.Clear(); ClGlobul.HashCommentMessage.Clear(); } catch { } try { btn_HashTags_Comment_BrowseUsers.Visibility = Visibility.Hidden; btn_HashTags_Comment_messagebrwer.Visibility = Visibility.Hidden; txt_HashTags_Comment_Message.Visibility = Visibility.Hidden; txt_HashTags_Comment_UserName.Visibility = Visibility.Hidden; Username_Copy.Visibility = Visibility.Hidden; Message.Visibility = Visibility.Hidden; } catch { }; try { txt_HashTags_Comment_Message.IsReadOnly = false; txt_HashTags_Comment_UserName.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Hash Key Here "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllDataHashkey(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private void chk_GroupStatusUpdate_GetGroups_Checked(object sender, RoutedEventArgs e) { //try //{ // if (LDGlobals.listAccounts.Count > 0) // { // var window = new ModernDialog // { // Content = new UserControlGEtGroupsForStatusUpdate() // }; // window.MinWidth = 550; // window.MinHeight = 350; // window.Title = "Upload Follow Details"; // window.ShowDialog(); // } // else // { // MessageBox.Show("Please upload accounts."); // return; // } //} //catch (Exception ex) //{ // // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); //} try { UserControlGEtGroupsForStatusUpdate obj = new UserControlGEtGroupsForStatusUpdate(); var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; Button customButton = new Button() { Content = "Save" }; customButton.Click += (ss, ee) => { closeEvent(); window.Close(); }; window.Buttons = new Button[] { customButton }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : 55" + ex.Message); } }
private void rdo_Hashlikecomment_single_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.HashCommentwithlike.Clear(); ClGlobul.HashCommentMessagewithlike.Clear(); } catch { } try { btu_Browse_hashkey.Visibility = Visibility.Hidden; btu_Browse_Message.Visibility = Visibility.Hidden; txt_Message_loades.Visibility = Visibility.Hidden; txt_hashkey_loades.Visibility = Visibility.Hidden; Enter_HashKey.Visibility = Visibility.Hidden; Enter_Message.Visibility = Visibility.Hidden; } catch { }; try { txt_Message_loades.IsReadOnly = false; txt_hashkey_loades.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Hash Key Here "; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllDataHashkey(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private void rdoBtn_LikeBy_Username_SingleUser_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.PhotoList.Clear(); } catch { } try { btn_LikePhoto_Username_BrowseUsers.Visibility = Visibility.Hidden; txt_LikePhoto_Username_LoadUsersPath.Visibility = Visibility.Hidden; Likeby_Username.Visibility = Visibility.Hidden; } catch { }; try { txt_LikePhoto_Username_LoadUsersPath.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Username Here : "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllData2(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private void rdoBtn_commentMessage_SingleId_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.lst_ScrapeCommentMessagePhotoId.Clear(); txt_PhotoId_Commentmessage.Text = string.Empty; } catch { } try { btn_PhotoId_Commentmessage.Visibility = Visibility.Hidden; txt_PhotoId_Commentmessage.Visibility = Visibility.Hidden; Photo_ID.Visibility = Visibility.Hidden; } catch { }; try { txt_PhotoId_Commentmessage.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Photo ID here to Scrape there Comment Message : "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "Save" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (sa, pa) => { SaveAllData(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
/// <summary>Simple input dialog box</summary> /// <returns>null if the dialog box was closed with "cancel", /// otherwise the user input<returns> public static string ShowInputDialog(string initialTitle = "", string initialText = "", string initialInput = null) { // create the dialog content TextBox content = new TextBox() { VerticalAlignment = VerticalAlignment.Bottom, TabIndex = 0 }; content.Text = initialInput; Label lbl = new Label() { Content = initialText, VerticalAlignment = VerticalAlignment.Top, Focusable = false }; Grid g = new Grid() { Height = 50, Focusable = false }; g.Children.Add(content); g.Children.Add(lbl); // create the ModernUI dialog component with the buttons var dlg = new ModernDialog { Title = initialTitle, ShowInTaskbar = false, Content = g, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, }; FocusManager.SetFocusedElement(g, content); content.SelectAll(); dlg.Buttons = new Button[] { dlg.OkButton, dlg.CancelButton }; // register the event to retrieve the result of the dialog box string result = null; dlg.OkButton.Click += (object sender, RoutedEventArgs e) => { result = content.Text; }; dlg.ShowDialog(); return result; }
private void CheckBox_Checked_2(object sender, RoutedEventArgs e) { try { var window = new ModernDialog { Content = new UserControlMessageInputForGroups() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
public bool? ShowOkMessage(string message, string title) { var dlg = new ModernDialog { Title = title, Content = new BBCodeBlock { BBCode = message, Margin = new Thickness(0, 0, 0, 8) }, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, }; // Localize buttons dlg.OkButton.Content = LocalizationService.Localize("Ok"); dlg.Buttons = new List<Button> { dlg.OkButton }; return dlg.ShowDialog(); }
private async void UserControl_Initialized(object sender, EventArgs e) { this.mpr.IsActive = true; try { this._sent = await Task.Run(() => getSent()); displayMails(); } catch (Exception ex) { ModernDialog md = new ModernDialog(); md.Title = "Error"; md.Content = ex.Message; md.Buttons = new List<Button>() { md.OkButton }; md.ShowDialog(); } this.mpr.IsActive = false; }
private void CheckBox_Checked_1(object sender, RoutedEventArgs e) { try { GlobalsAddConn.selectedManageConnKeyword = true; var window = new ModernDialog { Content = new UserControlAddConnectionByKeyword() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private void CheckBox_Checked(object sender, RoutedEventArgs e) { try { var window = new ModernDialog { Content = new UserControlGetFirstConnectionForMessageSending() }; window.MinWidth = 550; window.MinHeight = 350; window.Title = "Get The First Connection"; window.ShowDialog(); } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } // new UserControlGetFirstConnectionForMessageSending() }
public static ModernInputDialogMessageBoxResult ShowInputMessage(string text, string title, MessageBoxButton button, Window owner = null) { var dlg = new ModernDialog { Title = title, Content = CreateContent(text), MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, }; if (owner != null) { dlg.Owner = owner; } dlg.Buttons = GetButtons(dlg, button); dlg.ShowDialog(); return new ModernInputDialogMessageBoxResult() { MessageBoxResult = dlg.MessageBoxResult, Input = textBox.Text}; }
public static void Show(NonfatalErrorEntry entry) { var text = (entry.Exception == null ? $"{entry.DisplayName}." : $"{entry.DisplayName}:\n\n[b][mono]{entry.Exception.Message}[/mono][/b]") + (entry.Commentary == null ? "" : $"\n\n[i]{entry.Commentary}[/i]"); var dlg = new ModernDialog { Title = UiStrings.Common_Oops, Content = new ScrollViewer { Content = new BbCodeBlock { BbCode = text, Margin = new Thickness(0, 0, 0, 8) }, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled }, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640 }; dlg.Buttons = entry.Solutions.Select(x => dlg.CreateFixItButton(x, entry)).Where(x => x != null).Union(new[] { dlg.OkButton }); dlg.Show(); entry.Unseen = false; }
private void OnShowMiniSpecialDialog(object sender, ExecutedRoutedEventArgs e) { var dlg = new ModernDialog { Title = "Help & code window", Content = new SpecialWindowControl(e.Parameter), ResizeMode = ResizeMode.CanResize, MaxWidth = 1920, MaxHeight = 1080, MinWidth = 700, MinHeight = 500, Width = 700, Height = 500, SizeToContent = SizeToContent.Manual, }; dlg.OkButton.Content = "OK"; dlg.OkButton.VerticalContentAlignment = VerticalAlignment.Center; //dlg.OkButton.FontWeight = FontWeights.Bold; dlg.Buttons = new[] { dlg.OkButton }; dlg.ShowDialog(); }
private async void initMails() { this.mpr.IsActive = true; try { this._sent = await Task.Run(() => getSent()); displayMails(); } catch (Exception ex) { ModernDialog md = new ModernDialog(); md.Title = "Error"; md.Content = ex.Message; md.Buttons = new List<Button>() { md.OkButton }; md.ShowDialog(); } MailManager.GetInstance().SentAlreadyLoaded = true; this.mpr.IsActive = false; this.btnRefresh.IsEnabled = true; }
private void btnJobOk_Click(object sender, RoutedEventArgs e) { this.parent = this.Parent as ModernDialog; var ok = true; if (NewJob.JobType == JobType.Tags) { if (String.IsNullOrWhiteSpace(NewJob.SearchTag)) { ModernDialog.ShowMessage("Query String cannot be empty!", "Error", MessageBoxButton.OK); ok = false; } } else if (NewJob.JobType == JobType.Image) { if (NewJob.ImageId <= 0) { ModernDialog.ShowMessage("Image ID must be larger than 0!", "Error", MessageBoxButton.OK); ok = false; } } else if (NewJob.JobType == JobType.Member) { if (NewJob.MemberId <= 0) { ModernDialog.ShowMessage("Member ID must be larger than 0!", "Error", MessageBoxButton.OK); ok = false; } } // update filenamelist var mainWindow = Application.Current.MainWindow as MainWindow; mainWindow.ValidateFormatList(new string[] { NewJob.SaveFilenameFormat, NewJob.SaveMangaFilenameFormat, NewJob.SaveAvatarFilenameFormat }); if (ok) { parent.DialogResult = true; } }
public static string ShowMessage(string text, string title, Window owner, params ButtonDef[] buttons) { string result = null; var dialog = new ModernDialog { Title = title, Content = new BBCodeBlock {BBCode = text, Margin = new Thickness(0, 0, 0, 8)}, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, Owner = owner }; dialog.Buttons = buttons.Select(def => CreateButton(def, () => { result = def.Name; dialog.Close(); })); dialog.ShowDialog(); return result; }
private void btnSelectEmail_Click(object sender, RoutedEventArgs e) { try { bool? asdf = new SelectEmailWindow().ShowDialog(); if (gmap.Markers.Count > 0) { initializeMap(); } this.txtCanvas.Visibility = System.Windows.Visibility.Visible; initializeMarkers(); } catch (Exception ex) { ModernDialog mde = new ModernDialog(); mde.Title = "Error"; mde.Content = ex.Message; mde.Buttons = new List<Button>() { mde.OkButton }; mde.ShowDialog(); } }
//Skopiowane z kodu źródłowego private static IEnumerable<Button> GetButtons(ModernDialog owner, MessageBoxButton button) { if (button == MessageBoxButton.OK) { yield return owner.OkButton; } else if (button == MessageBoxButton.OKCancel) { yield return owner.OkButton; yield return owner.CancelButton; } else if (button == MessageBoxButton.YesNo) { yield return owner.YesButton; yield return owner.NoButton; } else if (button == MessageBoxButton.YesNoCancel) { yield return owner.YesButton; yield return owner.NoButton; yield return owner.CancelButton; } }
private async void btnRefresh_Click(object sender, RoutedEventArgs e) { this.mpr.IsActive = true; this.btnRefresh.IsEnabled = false; this.EmailList.SelectedIndex = -1; this.deleteFileContent(); try { this._inbox = await Task.Run(() => getInbox()); displayMails(); } catch (Exception ex) { ModernDialog md = new ModernDialog(); md.Title = "Error"; md.Content = ex.Message; md.Buttons = new List<Button>() { md.OkButton }; md.ShowDialog(); } this.mpr.IsActive = false; this.btnRefresh.IsEnabled = true; }
private void save_Executed (object sender, ExecutedRoutedEventArgs e) { try { var dialog = new ModernDialog { Title="EStation", Content="Ete vous sure de confirmer cette transaction ?" }; if(dialog.ShowDialogOkCancel()!=MessageBoxResult.OK) return; var newTransaction = (Transaction) _GRID.DataContext; if ((TransactionType) (_TRANS_TYPE.SelectedValue) == TransactionType.Expense) newTransaction.Amount = - newTransaction.Amount; App.Store.Economat.Finance.NewTransaction(newTransaction); } catch (Exception ex) { ModernDialog.ShowMessage(ex.Message, "ERREUR", MessageBoxButton.OK); } ModernDialog.ShowMessage("Enregistrer avec Success !", "EStation", MessageBoxButton.OK); e.Handled=true; Close(); }
/// <summary> /// 显示提示消息 /// </summary> /// <param name="message">提示信息</param> /// <param name="title">标题</param> protected void ShowMessage(string message, string title = "提示:") { ModernDialog.ShowMessage(message, title, MessageBoxButton.OK); }
public void rdbSingleUserComment() { try { objCommentManagers.rdbSingleUserComment = true; objCommentManagers.rdbMultipleUserComment = false; btnMessage_Comment_Browse.Visibility = Visibility.Hidden; txtCommentMessage.Visibility = Visibility.Hidden; lbMsg_Comment.Visibility = Visibility.Hidden; ClGlobul.CommentMessagesList.Clear(); try { UserControl_SingleUser obj = new UserControl_SingleUser(); obj.UserControlHeader.Text = "Enter Message Here "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; customButton.Click += (ss, ee) => { closeEvent(); window.Close(); }; window.Buttons = new Button[] { customButton }; window.ShowDialog(); MessageBoxButton btnC = MessageBoxButton.YesNo; var result = ModernDialog.ShowMessage("Are you sure want to save ?", "Message Box", btnC); if (result == MessageBoxResult.Yes) { TextRange textRange = new TextRange(obj.txtEnterSingleMessages.Document.ContentStart, obj.txtEnterSingleMessages.Document.ContentEnd); if (!string.IsNullOrEmpty(textRange.Text)) { string enterText = textRange.Text; string[] arr = Regex.Split(enterText, "\r\n"); foreach (var arr_item in arr) { if (!string.IsNullOrEmpty(arr_item) || !arr_item.Contains("")) { ClGlobul.CommentMessagesList.Add(arr_item); } } } GlobusLogHelper.log.Info(" => [ Message Loaded : " + ClGlobul.CommentMessagesList.Count + " ]"); GlobusLogHelper.log.Debug("Message : " + ClGlobul.CommentMessagesList.Count); } } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private static MessageBoxResult ShowMessageInner(string text, string title, MessageBoxButton button, ShowMessageCallbacks doNotAskAgainLoadSave, Window owner = null) { var value = doNotAskAgainLoadSave?.Item1?.Invoke(); if (value != null) { return(value.Value); } FrameworkElement content = new SelectableBbCodeBlock { BbCode = text, Margin = new Thickness(0, 0, 0, 8) }; CheckBox doNotAskAgainCheckbox; if (doNotAskAgainLoadSave != null) { doNotAskAgainCheckbox = new CheckBox { Content = new Label { Content = "Don’t ask again" } }; content = new SpacingStackPanel { Spacing = 8, Children = { content, doNotAskAgainCheckbox } }; } else { doNotAskAgainCheckbox = null; } var dlg = new ModernDialog { Title = title.ToTitle(), Content = new ScrollViewer { Content = content, MaxWidth = 640, MaxHeight = 520, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled }, MinHeight = 0, MinWidth = 0, MaxHeight = 640, MaxWidth = 800 }; if (owner != null) { dlg.Owner = owner; } dlg.Buttons = GetButtons(dlg, button); dlg.ShowDialog(); if (doNotAskAgainCheckbox != null) { doNotAskAgainLoadSave.Item2.Invoke(doNotAskAgainCheckbox.IsChecked == true ? dlg.MessageBoxResult : (MessageBoxResult?)null); } return(dlg.MessageBoxResult); }