Call CalculatePosition if CenteredScreen.Title gets changed

This commit is contained in:
JFronny 2020-06-12 12:20:04 +02:00
parent fb44579b33
commit a70f4f4393
1 changed files with 17 additions and 5 deletions

View File

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