Fixed Window State being cleared when changing Languages.

This commit is contained in:
Brett Hewitson 2022-03-03 13:31:11 +10:00
parent ec1751cc20
commit eb23acc64e
4 changed files with 30 additions and 16 deletions

View file

@ -33,7 +33,8 @@ namespace ServerManagerTool
public static readonly DependencyProperty IsAdministratorProperty = DependencyProperty.Register(nameof(IsAdministrator), typeof(bool), typeof(GlobalSettingsControl), new PropertyMetadata(false));
public static readonly DependencyProperty ConfigProperty = DependencyProperty.Register(nameof(Config), typeof(Config), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty CommonConfigProperty = DependencyProperty.Register(nameof(CommonConfig), typeof(CommonConfig), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty WindowStatesProperty = DependencyProperty.Register(nameof(WindowStates), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty WindowStatesMainWindowProperty = DependencyProperty.Register(nameof(WindowStatesMainWindow), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty WindowStatesServerMonitorProperty = DependencyProperty.Register(nameof(WindowStatesServerMonitor), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty DiscordBotLogLevelsProperty = DependencyProperty.Register(nameof(DiscordBotLogLevels), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty DiscordBotWhitelistProperty = DependencyProperty.Register(nameof(DiscordBotWhitelist), typeof(List<DiscordBotWhitelistItem>), typeof(GlobalSettingsControl), new PropertyMetadata(null));
@ -91,10 +92,16 @@ namespace ServerManagerTool
set { SetValue(IsAdministratorProperty, value); }
}
public ComboBoxItemList WindowStates
public ComboBoxItemList WindowStatesMainWindow
{
get { return (ComboBoxItemList)GetValue(WindowStatesProperty); }
set { SetValue(WindowStatesProperty, value); }
get { return (ComboBoxItemList)GetValue(WindowStatesMainWindowProperty); }
set { SetValue(WindowStatesMainWindowProperty, value); }
}
public ComboBoxItemList WindowStatesServerMonitor
{
get { return (ComboBoxItemList)GetValue(WindowStatesServerMonitorProperty); }
set { SetValue(WindowStatesServerMonitorProperty, value); }
}
public ComboBoxItemList DiscordBotLogLevels
@ -502,7 +509,7 @@ namespace ServerManagerTool
comboBoxList.Add(new Common.Model.ComboBoxItem(windowState.ToString(), displayMember));
}
this.WindowStates = comboBoxList;
this.WindowStatesMainWindow = comboBoxList;
if (this.WindowStateMainWindowComboBox != null)
{
this.WindowStateMainWindowComboBox.SelectedValue = selectedValue;
@ -520,7 +527,7 @@ namespace ServerManagerTool
comboBoxList.Add(new Common.Model.ComboBoxItem(windowState.ToString(), displayMember));
}
this.WindowStates = comboBoxList;
this.WindowStatesServerMonitor = comboBoxList;
if (this.WindowStateServerMonitorComboBox != null)
{
this.WindowStateServerMonitorComboBox.SelectedValue = selectedValue;