private void Refresh(object sender, RoutedEventArgs e) { DbCategoryAction dbCategoryAction = new DbCategoryAction(RefreshCategories); dbCategoryAction.BeginInvoke(null, null); if (categoriesComboBox.SelectedItem != null) { DbProductAction dbProductAction = new DbProductAction(RefreshProducts); dbProductAction.BeginInvoke((Category)categoriesComboBox.SelectedItem, null, null); } }
private void CategoriesComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e) { if (categoriesComboBox.SelectedItem != null) { DbProductAction dbProductAction = new DbProductAction(RefreshProducts); dbProductAction.BeginInvoke((Category)categoriesComboBox.SelectedItem, null, null); } else { MessageBox.Show("Выберите категорию"); } }