//Services private void ControlsDataGrid_Services_SelectionChanged(object sender, SelectionChangedEventArgs e) { using (GroomingDbContext db = new GroomingDbContext()) { db.Species.Load(); DataGrid dg = sender as DataGrid; if (dg.SelectedItem is Service service) { ControlDetailServices.DataContext = service; if (service.Species != null) { ServicesSpeciesCmbBox.DataContext = db.Species.Local.Where(o => o.Id == service.Species.Id); ServicesSpeciesCmbBox.SelectedIndex = 0; } if (service.HomeCare) { ServicesHomeCareChkBox.Content = "Yes"; } else { ServicesHomeCareChkBox.Content = "No"; } } } }