diff --git a/Terminal.Gui/Windows/Dialog.cs b/Terminal.Gui/Windows/Dialog.cs index 80d0aa221..5696adbff 100644 --- a/Terminal.Gui/Windows/Dialog.cs +++ b/Terminal.Gui/Windows/Dialog.cs @@ -141,11 +141,14 @@ namespace Terminal.Gui { /// Right } + + private ButtonAlignments buttonAlignment = Dialog.ButtonAlignments.Center; + /// /// Determines how the s are aligned along the /// bottom of the dialog. /// - public ButtonAlignments ButtonAlignment = Dialog.ButtonAlignments.Center; + public ButtonAlignments ButtonAlignment { get => buttonAlignment; set => buttonAlignment = value; } void LayoutStartedHandler () { diff --git a/UICatalog/Scenarios/Dialogs.cs b/UICatalog/Scenarios/Dialogs.cs index e0055a4d5..6d43fd7ec 100644 --- a/UICatalog/Scenarios/Dialogs.cs +++ b/UICatalog/Scenarios/Dialogs.cs @@ -148,9 +148,12 @@ namespace UICatalog.Scenarios { }; showDialogButton.Clicked += () => { try { - int width = int.Parse (widthEdit.Text.ToString ()); - int height = int.Parse (heightEdit.Text.ToString ()); - int numButtons = int.Parse (numButtonsEdit.Text.ToString ()); + int width = 0; + int.TryParse (widthEdit.Text.ToString (), out width); + int height = 0; + int.TryParse (heightEdit.Text.ToString (), out height); + int numButtons = 3; + int.TryParse (numButtonsEdit.Text.ToString (), out numButtons); var buttons = new List