/// <summary> /// Uses the static GetBeers method of the Beer class to: /// - get a list of beers (from csv file) /// - show the beers in the listview /// </summary> private void LoadAllBeers() { //call static method GetBeers of Beer class List <Beer> allBeers = Beer.GetBeers(); //print all beers to output window using PrintBeers method lvwBeers.ItemsSource = allBeers; }
/// <summary> /// Uses the static GetBeers method of the Beer class to: /// - get a hard coded list of beers /// - print the beers in the list to the output window /// </summary> private void LoadAllBeers() { //call static method GetBeers of Beer class List <Beer> allBeers = Beer.GetBeers(); //print all beers to output window using PrintBeers method PrintBeers(allBeers); }
/// <summary> /// Uses the static GetBeers method of the Beer class to: /// - get a hard coded list of beers /// - print the beers in the list to the output window /// </summary> private void LoadAllBeers() { //call static method GetBeers of Beer class List <Beer> allBeers = Beer.GetBeers(); //Show all beers in listview using ItemSource property lstBeers.ItemsSource = allBeers; //print all beers to output window using PrintBeers method PrintBeers(allBeers); }
private void LoadBeerList() { if (IsAlcoholic == null) { lvwBeers.ItemsSource = Beer.GetBeers(); } else { lvwBeers.ItemsSource = Beer.GetBeersFiltered((bool)IsAlcoholic); } }
public void FilterBeerList(string filter) { this.Title = filter; //set the title of this page switch (filter) { //no filter: case null: case "all beers": lvwBeers.ItemsSource = Beer.GetBeers(); break; //alcohol free: case "alcohol free": lvwBeers.ItemsSource = Beer.GetBeersFiltered(true); break; //without alcohol free: case "alcoholic": lvwBeers.ItemsSource = Beer.GetBeersFiltered(false); break; } }