public void ViewPlants() { var orderedPlantLocation = Plants.OrderBy(p => p.LocatedPlanted); Console.Clear(); Console.WriteLine($"You currently have the following plants."); foreach (var plant in orderedPlantLocation) { Console.WriteLine($"Plant number {plant.Id} is {plant.Species} located in the {plant.LocatedPlanted} garden."); } // View All the current plants // this command will show the all the plants in a the list, ordered by LocationPlanted }
private void OnSortPlantsList(object obj) { string sortType = obj.ToString(); switch (sortType) { case "Poisionous": Plants = new ObservableCollection <PlantDetail>(Plants.OrderBy(c => c.Poisionous)); break; default: break; } }