public static MessageBoxResult ShowDialogOkCancel(this ModernDialog modernDialog) { modernDialog.set_Buttons(new Button[] { modernDialog.get_OkButton(), modernDialog.get_CancelButton() }); modernDialog.ShowDialog(); return(modernDialog.get_MessageBoxResult()); }
public static ModernDialog CreateModernDialog(string title, string content, string textYesButton = null, string textNoButton = null, string textOkButton = null, string textCancelButton = null) { ModernDialog expr_05 = new ModernDialog(); expr_05.Title = title; BBCodeBlock expr_12 = new BBCodeBlock(); expr_12.set_BBCode(content); expr_12.TextWrapping = TextWrapping.WrapWithOverflow; expr_05.Content = expr_12; ModernDialog modernDialog = expr_05; modernDialog.BorderBrush = (modernDialog.FindResource("YellowBaseBrush") as Brush); if (ObjectHolder.MainForm != null && ObjectHolder.MainForm.IsVisible) { modernDialog.Owner = ObjectHolder.MainForm; } modernDialog.get_YesButton().Content = (textYesButton ?? Components.ModernDialogExtension_CreateModernDialog_Yes); modernDialog.get_NoButton().Content = (textNoButton ?? Components.ModernDialogExtension_CreateModernDialog_No); modernDialog.get_OkButton().Content = (textOkButton ?? Components.ModernDialogExtension_CreateModernDialog_Ok); modernDialog.get_CancelButton().Content = (textCancelButton ?? Components.ModernDialogExtension_CreateModernDialog_Cancel); return(modernDialog); }