From ebb3f64511ff4a95d770727a31b2a2f09994979b Mon Sep 17 00:00:00 2001 From: rex706 Date: Wed, 28 Jun 2023 12:19:09 -0400 Subject: [PATCH] Set ItemSource in Loaded method * probably safer to initialize the ItemSource after we know the window and elements have been fully loaded #122 #139 --- Views/SettingsWindow.xaml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Views/SettingsWindow.xaml.cs b/Views/SettingsWindow.xaml.cs index f2a2600..aca99b3 100644 --- a/Views/SettingsWindow.xaml.cs +++ b/Views/SettingsWindow.xaml.cs @@ -49,16 +49,16 @@ public SettingsWindow() { InitializeComponent(); + Decrypt = false; settings = new SAMSettings(); - + Loaded += SettingsWindow_Loaded; - Decrypt = false; - - InputMethodSelectBox.ItemsSource = Enum.GetValues(typeof(VirtualInputMethod)).Cast(); } private void SettingsWindow_Loaded(object sender, RoutedEventArgs e) { + InputMethodSelectBox.ItemsSource = Enum.GetValues(typeof(VirtualInputMethod)).Cast(); + if (File.Exists(SAMSettings.FILE_NAME)) { try