diff --git a/Commandline/TUI/CenteredScreen.cs b/Commandline/TUI/CenteredScreen.cs index 928689b..f1f51cb 100644 --- a/Commandline/TUI/CenteredScreen.cs +++ b/Commandline/TUI/CenteredScreen.cs @@ -21,11 +21,7 @@ namespace CC_Functions.Commandline.TUI /// public Panel ContentPanel; - /// - /// The title to display at the top of the console - /// - public string Title = "CC-Functions.CommandLine app"; - + private string _title = "CC-Functions.CommandLine app"; private readonly Label _titleLabel; /// @@ -47,6 +43,22 @@ namespace CC_Functions.Commandline.TUI CalculatePosition(true); } + /// + /// The title to display at the top of the console + /// + public string Title + { + get => _title; + set + { + if (_title != value && !string.IsNullOrWhiteSpace(value)) + { + _title = value; + CalculatePosition(); + } + } + } + /// /// Calculates the Size variable, Title and ContentPanel position/size ///