Manage the current selected section

This commit is contained in:
Thorsten Sommer 2022-07-12 20:50:42 +02:00
parent 0193c8de0a
commit 10952769aa
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -1,9 +1,20 @@
namespace UI_WinForms.Components;
using DataModel.Database;
namespace UI_WinForms.Components;
public partial class TextElements : UserControl
{
private Section? currentSection;
public TextElements()
{
this.InitializeComponent();
// When the section is changed, update this component:
AppEvents.WhenSectionChanged += (sender, section) =>
{
this.currentSection = section;
this.buttonAdd.Enabled = this.currentSection is not null;
};
}
}