public static Task Launch(string displayName, Uri uri, string filter = null) { if (Holder.Active) { return(Task.Delay(0)); } Holder.Active = true; var dialog = new ModernDialog { Title = displayName, SizeToContent = SizeToContent.Manual, ResizeMode = ResizeMode.CanResizeWithGrip, LocationAndSizeKey = uri.ToString().Split('?')[0], MinWidth = 800, MinHeight = 480, Width = 800, Height = 640, MaxWidth = 99999, MaxHeight = 99999, Content = new ModernFrame { Source = string.IsNullOrWhiteSpace(filter) ? uri : uri.AddQueryParam("Filter", filter) } }; dialog.Closed += OnDialogClosed; return(dialog.ShowAndWaitAsync()); }
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(); })); }