private void MenuItem_Click(object sender, RoutedEventArgs e) { SetupProfileWindow setupProfileWindow = new SetupProfileWindow(); setupProfileWindow.SetupLayoutForAddingProfile(); setupProfileWindow.ShowDialog(); // Refresh Profile Selector cbxProfileSelector.ItemsSource = null; cbxProfileSelector.SelectedIndex = Session.SelectedProfileIndex; cbxProfileSelector.ItemsSource = Preferences.Profiles; if (Preferences.Profiles.Count != 0) { btnSettings.IsEnabled = true; btnSync.IsEnabled = true; cbxSync.IsEnabled = true; } }
private void btnSettings_Click(object sender, RoutedEventArgs e) { Session.SelectedProfileIndex = cbxProfileSelector.SelectedIndex; Session.Save(); SetupProfileWindow setupProfileWindow = new SetupProfileWindow(); setupProfileWindow.SetupLayoutForEditingProfile(); setupProfileWindow.ShowDialog(); // Refresh Profile Selector Preferences.Load(); cbxProfileSelector.ItemsSource = null; cbxProfileSelector.SelectedIndex = Session.SelectedProfileIndex; cbxProfileSelector.ItemsSource = Preferences.Profiles; if (Preferences.Profiles.Count == 0) { btnSettings.IsEnabled = false; btnSync.IsEnabled = false; cbxSync.IsEnabled = false; } }