/*--- Method: public ------------------------------------------------------------------------------------------------------------------------------------------*/ /// <summary> カラーダイアログを開き、結果をbool値で返却します。 /// </summary> /// <param name="owner"> ダイアログのオーナーウィンドウ </param> /// <returns> ダイアログのボタン押下結果 </returns> public bool?ShowColorDialog(Window owner = null) { var dialog = new ModernDialog { Title = "Please select a color.", Content = this.colorDialogView, Owner = owner, MaxWidth = 1280, MaxHeight = 768, WindowStartupLocation = WindowStartupLocation.CenterScreen, ResizeMode = ResizeMode.CanResize, Topmost = true, }; dialog.Buttons = new Button[] { dialog.OkButton, dialog.CancelButton }; dialog.OkButton.Click += (s, e) => this.colorDialogView.Apply(); dialog.MouseLeftButtonDown += (sender, e) => dialog.DragMove(); if (dialog.BackgroundContent == null) { Rectangle rct = new Rectangle(); rct.Fill = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF)); dialog.BackgroundContent = rct; } return(dialog.ShowDialog()); }
/// <summary> フォントダイアログを開き、結果をbool値で返却します。 /// </summary> /// <param name="owner"> ダイアログのオーナーウィンドウ </param> /// <returns> ダイアログのボタン押下結果 </returns> public bool?ShowFontDialog(Window owner = null) { var dialog = new ModernDialog { Title = "Please select a font.", Content = this.fontDialogView, Owner = owner, MaxWidth = 1280, MaxHeight = 768, WindowStartupLocation = WindowStartupLocation.CenterScreen, ResizeMode = ResizeMode.CanResize, Topmost = true, }; dialog.Buttons = new Button[] { dialog.OkButton, dialog.CancelButton }; dialog.OkButton.Click += this.fontDialogView.OKBUtton_Click; dialog.MouseLeftButtonDown += (sender, e) => dialog.DragMove(); return(dialog.ShowDialog()); }