Bugfix: Subscribers of app events must be reset when restarting

This commit is contained in:
Thorsten Sommer 2022-11-01 12:26:31 +01:00
parent c48466d91e
commit dfc0647fb0
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 10 additions and 1 deletions

View File

@ -4,7 +4,15 @@ namespace UI_WinForms;
internal static class AppEvents
{
#region Event: Settings were
internal static void ResetAllSubscriptions()
{
WhenSettingsChanged = null;
WhenSectionChanged = null;
WhenTextElementChanged = null;
WhenTranslationChanged = null;
}
#region Event: Settings were
internal static event EventHandler? WhenSettingsChanged;

View File

@ -16,6 +16,7 @@ public partial class Main : UserControl
if(result == DialogResult.Yes)
{
Program.RestartMainApp = true;
AppEvents.ResetAllSubscriptions();
this.ParentForm!.Close();
}
}