set title panel visibility

This commit is contained in:
2024-06-10 12:05:39 +02:00
parent a8c14d65c0
commit 94aeca2ca1

View File

@@ -38,13 +38,21 @@ public partial class RadFlyoutBase : UserControl
public string Title public string Title
{ {
get => radLabel_Title.Text; get => radLabel_Title.Text;
set => radLabel_Title.Text = value; set
{
radLabel_Title.Text = value;
SetShowTitlePanel();
}
} }
public RadSvgImage TitleIcon public RadSvgImage TitleIcon
{ {
get => radLabel_Title.SvgImage; get => radLabel_Title.SvgImage;
set => radLabel_Title.SvgImage = value; set
{
radLabel_Title.SvgImage = value;
SetShowTitlePanel();
}
} }
protected RadFlyoutBase() protected RadFlyoutBase()
@@ -79,6 +87,16 @@ public partial class RadFlyoutBase : UserControl
CloseFlyout(); CloseFlyout();
} }
protected virtual bool ValidateOK()
{
return true;
}
private void SetShowTitlePanel()
{
tableLayoutPanel_TitlePanel.Visible = !string.IsNullOrWhiteSpace(radLabel_Title.Text) || radLabel_Title.SvgImage != null;
}
private void RadButton_Confirm_Click(object sender, EventArgs e) private void RadButton_Confirm_Click(object sender, EventArgs e)
{ {
if (ValidateOK()) if (ValidateOK())
@@ -89,9 +107,4 @@ public partial class RadFlyoutBase : UserControl
{ {
Close(DialogResult.Cancel); Close(DialogResult.Cancel);
} }
protected virtual bool ValidateOK()
{
return true;
}
} }