From 0193c8de0a4ccbbb6dd809fb404e61eda81ecac2 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 12 Jul 2022 20:50:25 +0200 Subject: [PATCH] Fire the section changed event --- I18N Commander/UI WinForms/Components/SectionTree.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/I18N Commander/UI WinForms/Components/SectionTree.cs b/I18N Commander/UI WinForms/Components/SectionTree.cs index 02ede17..a436b59 100644 --- a/I18N Commander/UI WinForms/Components/SectionTree.cs +++ b/I18N Commander/UI WinForms/Components/SectionTree.cs @@ -196,6 +196,14 @@ public partial class SectionTree : UserControl // If the selected node is not null, enable the remove & edit button: this.buttonRename.Enabled = this.buttonRemove.Enabled = selectedNode is not null; + + // When a section is selected, fire the event: + if (selectedNode is not null) + { + // Get the section from the database: + var section = SectionProcessor.GetSection(this.db, selectedNode.Name); + AppEvents.SectionChanged(section); + } } private async void buttonRename_Click(object sender, EventArgs e)