public RegisterGardensController(IGardenService gardenServices, ICountyService countyService, IGardenTypeService gardenTypeService, IGardenSizeService gardenSizeService, IGardenReasonService gardenReasonService, IPlantTypeService plantTypeService) { GardenServices = gardenServices; CountyService = countyService; GardenTypeService = gardenTypeService; GardenSizeService = gardenSizeService; GardenReasonService = gardenReasonService; PlantTypeService = plantTypeService; }
public CheckedListBox(IPlantTypeService plantTypeService, int idForm) { var i = plantTypeService.GetSpeciesOfForm(idForm); Items = new List <Species>(); foreach (var temp in i) { Species species = new Species() { Id = temp.Key, Name = temp.Value, IsChecked = false }; Items.Add(species); } }
public MainWindow() { InitializeComponent(); plantTypeService = new PlantTypeService("Context"); species = plantTypeService.GetAll(); TabTree.DataContext = new CheckedListBox(plantTypeService, 1); TabBush.DataContext = new CheckedListBox(plantTypeService, 2); TabGrass.DataContext = new CheckedListBox(plantTypeService, 3); //bushspecies.datacontext = planttypeservice.getspeciesofform(2); //grassSpecies.DataContext = plantTypeService.GetSpeciesOfForm(3); dataGridTree.ItemsSource = species; dataGridBush.ItemsSource = species; grassGridBush.ItemsSource = species; }