private void LoadManufacturers() { var mfgs = App.InventoryRepository.GetAllManufacturers(); uxMfgList.ItemsSource = mfgs .Select(t => MfgModel.ToModel(t)) .ToList(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (Manufacturer != null) { uxSubmit.Content = "Update"; } else { Manufacturer = new MfgModel(); } uxMfgGrid.DataContext = Manufacturer; }
private void uxMfgList_SelectionChanged(object sender, SelectionChangedEventArgs e) { selectedManufacturer = (MfgModel)uxMfgList.SelectedValue; // This event doesn't catch the use of the keyboard's context menu key if haven't first clicked a selection }
private void uxMfgDelete_Click(object sender, RoutedEventArgs e) { App.InventoryRepository.RemoveMfg(selectedManufacturer.Id); selectedManufacturer = null; LoadManufacturers(); }