2022-07-12 18:50:42 +00:00
|
|
|
|
using DataModel.Database;
|
|
|
|
|
|
|
|
|
|
namespace UI_WinForms.Components;
|
2022-07-11 17:52:15 +00:00
|
|
|
|
|
|
|
|
|
public partial class TextElements : UserControl
|
|
|
|
|
{
|
2022-07-12 18:50:42 +00:00
|
|
|
|
private Section? currentSection;
|
|
|
|
|
|
2022-07-11 17:52:15 +00:00
|
|
|
|
public TextElements()
|
|
|
|
|
{
|
|
|
|
|
this.InitializeComponent();
|
2022-07-12 18:50:42 +00:00
|
|
|
|
|
|
|
|
|
// When the section is changed, update this component:
|
|
|
|
|
AppEvents.WhenSectionChanged += (sender, section) =>
|
|
|
|
|
{
|
|
|
|
|
this.currentSection = section;
|
|
|
|
|
this.buttonAdd.Enabled = this.currentSection is not null;
|
|
|
|
|
};
|
2022-07-11 17:52:15 +00:00
|
|
|
|
}
|
|
|
|
|
}
|