Ejemplo n.º 1
0
 private void RefreshCategories()
 {
     this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (ThreadStart) delegate
     {
         using (var context = new ManagerDbContext())
         {
             categoriesComboBox.ItemsSource = context.Categories.ToList();
         }
     });
 }
Ejemplo n.º 2
0
 private void RefreshProducts(Category category)
 {
     this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (ThreadStart) delegate
     {
         using (var context = new ManagerDbContext())
         {
             productsComboBox.ItemsSource = context.Products.Where(x => x.Category.Id.Equals(category.Id)).ToList();
         }
     });
 }