Resolve "Component: Text Element Navigator" #67

Merged
thorsten merged 43 commits from 11-component-text-element-navigator into main 2022-07-23 19:29:16 +00:00
Showing only changes of commit 10952769aa - Show all commits
@@ -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;
};
} }
} }