Skip to content

Commit

Permalink
Set ItemSource in Loaded method
Browse files Browse the repository at this point in the history
* probably safer to initialize the ItemSource after we know the window and elements have been fully loaded #122 #139
  • Loading branch information
rex706 committed Jun 28, 2023
1 parent 8f92f81 commit ebb3f64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Views/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ public SettingsWindow()
{
InitializeComponent();

Decrypt = false;
settings = new SAMSettings();

Loaded += SettingsWindow_Loaded;
Decrypt = false;

InputMethodSelectBox.ItemsSource = Enum.GetValues(typeof(VirtualInputMethod)).Cast<VirtualInputMethod>();
}

private void SettingsWindow_Loaded(object sender, RoutedEventArgs e)
{
InputMethodSelectBox.ItemsSource = Enum.GetValues(typeof(VirtualInputMethod)).Cast<VirtualInputMethod>();

if (File.Exists(SAMSettings.FILE_NAME))
{
try
Expand Down

0 comments on commit ebb3f64

Please sign in to comment.