public static ICommand GetShowSettingsCommand()
        {
            return(new AsyncCommand(() => {
                var dlg = new ModernDialog {
                    ShowTitle = false,
                    Content = new SettingsShadersPatchPopup(),
                    MinHeight = 400,
                    MinWidth = 450,
                    MaxHeight = 99999,
                    MaxWidth = 700,
                    Padding = new Thickness(0),
                    ButtonsMargin = new Thickness(8),
                    SizeToContent = SizeToContent.Manual,
                    ResizeMode = ResizeMode.NoResize,
                    WindowStyle = WindowStyle.None,
                    AllowsTransparency = true,
                    BlurBackground = true,
                    ShowTopBlob = false,
                    Topmost = true,
                    Title = "Custom Shaders Patch settings",
                    LocationAndSizeKey = @".CustomShadersPatchDialog",
                    Owner = null,
                    Buttons = new Control[0],
                    BorderThickness = new Thickness(0),
                    Opacity = 0.9,
                    BorderBrush = new SolidColorBrush(Colors.Transparent)
                };

                dlg.Background = new SolidColorBrush(((Color)dlg.FindResource("WindowBackgroundColor")).SetAlpha(200));

                return dlg.ShowAndWaitAsync();
            }));
        }
Example #2
0
        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);
        }