Ejemplo n.º 1
0
        private void LoadManufacturers()
        {
            var mfgs = App.InventoryRepository.GetAllManufacturers();

            uxMfgList.ItemsSource = mfgs
                                    .Select(t => MfgModel.ToModel(t))
                                    .ToList();
        }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (Manufacturer != null)
            {
                uxSubmit.Content = "Update";
            }
            else
            {
                Manufacturer = new MfgModel();
            }

            uxMfgGrid.DataContext = Manufacturer;
        }
Ejemplo n.º 3
0
 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
 }
Ejemplo n.º 4
0
 private void uxMfgDelete_Click(object sender, RoutedEventArgs e)
 {
     App.InventoryRepository.RemoveMfg(selectedManufacturer.Id);
     selectedManufacturer = null;
     LoadManufacturers();
 }