Manage the current selected section
This commit is contained in:
parent
0193c8de0a
commit
10952769aa
@ -1,9 +1,20 @@
|
|||||||
namespace UI_WinForms.Components;
|
using DataModel.Database;
|
||||||
|
|
||||||
|
namespace UI_WinForms.Components;
|
||||||
|
|
||||||
public partial class TextElements : UserControl
|
public partial class TextElements : UserControl
|
||||||
{
|
{
|
||||||
|
private Section? currentSection;
|
||||||
|
|
||||||
public TextElements()
|
public TextElements()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
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;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user