private void btnColor_Click(object sender, RoutedEventArgs e) { if (colorwindows == null) { colorwindows = new ColorWindow(); colorwindows.Show(); colorwindows.Closed += colorwindows_Closed; } else { colorwindows.Show(); } }
void colorwindows_Closed(object sender, EventArgs e) { colorwindows = null; var isChange = (sender as ColorWindow).IsChangeData; if (!isChange) return; var dataContext = (MainWindowViewModel)this.DataContext; var userPrefs = new UserPreferences(); dataContext.SetBible(userPrefs.BibileLocation); //BibleBooksComboBox.SelectedIndex = BibleBooksComboBox.SelectedIndex; //cboDoan.SelectedIndex = cboDoan.SelectedIndex; }