Bend.StyledMessageBox.Show C# (CSharp) Метод

Show() публичный статический Метод

public static Show ( string title, string message, bool onDarkBackground = false ) : bool
title string
message string
onDarkBackground bool
Результат bool
        public static bool Show(string title, string message, bool onDarkBackground = false)
        {
            StyledMessageBox messageBox = new StyledMessageBox();
            messageBox.Title = title;
            messageBox.Message = message;
            messageBox.Owner = Application.Current.MainWindow;
            if (onDarkBackground)
            {
                messageBox.ShadowBorder.Color = Colors.WhiteSmoke;
                messageBox.ShadowBorder.Opacity = 0.58;
            }
            messageBox.ShowDialog();

            return messageBox.OkButtonClicked;
        }

Usage Example

Пример #1
0
        private void SavePlusButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                if (this.currentTabIndex >= 0)
                {
                    try
                    {
                        SaveFileDialog dlg = new SaveFileDialog();
                        if (this.currentTabIndex >= 0 && this.tab[this.currentTabIndex].FullFileName != null)
                        {
                            string initialDirectory = System.IO.Path.GetDirectoryName(this.tab[this.currentTabIndex].FullFileName);
                            if (initialDirectory != null && initialDirectory.Length != 0)
                            {
                                dlg.InitialDirectory = initialDirectory;
                            }
                        }

                        FileExtensions flex = new FileExtensions();
                        dlg.Filter = flex.GetFilterString();
                        if (dlg.ShowDialog(this) ?? false)
                        {
                            this.tab[this.currentTabIndex].SaveFile(dlg.FileName);
                        }
                    }
                    catch (Exception exception)
                    {
                        StyledMessageBox.Show("ERROR", "Error Saving File" + exception.ToString());
                    }
                }
            }
            e.Handled = true;
        }
All Usage Examples Of Bend.StyledMessageBox::Show