private void Btn_CategoriesAddCategory_Click(object sender, RoutedEventArgs e) { AddCategoryDlg addCategory = new AddCategoryDlg(); addCategory.Closed += new EventHandler(CategoriesAddGenre_Close); addCategory.Show(); }
private void CategoriesAddGenre_Close(object sender, EventArgs e) { _CatTable = _catTableModel.CategoryTable; CategoriesDataGrid.DataContext = _CatTable.DefaultView; CategoriesDataGrid.Items.Refresh(); AddCategoryDlg addCategory = sender as AddCategoryDlg; string target = addCategory.NewGenre; }
private void InitCategorySelection() { List <string> categories = ((App)Application.Current).Model.CategoryTable.ListBoxSelectionList(); LB_CategorySelector.DataContext = categories; if (categories.Count < 1) { string mbMsg = "There are no genres, please add one?"; MessageBoxResult messageBoxResult = MessageBox.Show(mbMsg, "Add Category Confirmation", MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { AddCategoryDlg AddAuthorControl = new AddCategoryDlg(); AddAuthorControl.Show(); return; } } LB_CategorySelector.Items.Clear(); foreach (string category in categories) { LB_CategorySelector.Items.Add(category); } }