Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MenuItem
- {
- public static string type { get; set; }
- public static string name { get; set; }
- public static double cost { get; set; }
- public MenuItem(string type,string name,double cost)
- {
- MenuItem.type = type;
- MenuItem.name = name;
- MenuItem.cost = cost;
- }
- }
- public sealed partial class MainPage : Page
- {
- public MainPage()
- {
- this.InitializeComponent();
- MenuItem.type = "Breakfast";
- MenuItem.name = "Bacon and Eggs";
- MenuItem.cost = 5.00;
- }
- private void BreakfastButton_Click(object sender, RoutedEventArgs e)
- {
- BreakfastView.Items.Clear();
- MenuItem[] newItems = new MenuItem[20];
- newItems[0] = new MenuItem("Breakfast","Bacon and Eggs",5.00);
- newItems[1] = new MenuItem("Breakfast", "Pancakes", 4.25);
- newItems[2] = new MenuItem("Lunch", "Fruit Salad",3.00);
- newItems[3] = new MenuItem("Breakfast", "Oatmeal",3.00);
- newItems[4] = new MenuItem("Lunch", "Lemon Chicken",19.25);
- newItems[5] = new MenuItem("Breakfast", "Blue Berry Muffin",3.50);
- newItems[6] = new MenuItem("Dinner", "Salmon",23.50);
- newItems[7] = new MenuItem("Breakfast", "Omlette",5.00);
- newItems[8] = new MenuItem("Breakfast", "Waffles",4.00);
- newItems[9] = new MenuItem("Breakfast", "Cinnamon Roll",4.00);
- newItems[10] = new MenuItem("Breakfast", "Donut",2.50);
- newItems[11] = new MenuItem("Breakfast", "Chocolate Pancakes",4.50);
- newItems[12] = new MenuItem("Dinner", "Filet Mignon",34.50);
- newItems[13] = new MenuItem("Lunch", "Burrito", 9.00);
- newItems[14] = new MenuItem("Breakfast", "Cereal",3.00);
- newItems[15] = new MenuItem("Breakfast", "Avacado Toast",2.50);
- newItems[16] = new MenuItem("Dinner", "Sirloin Steak",25.45);
- newItems[17] = new MenuItem("Breakfast", "Steak and Eggs",8.50);
- newItems[18] = new MenuItem("Lunch", "Chicken Paninni",14.50);
- newItems[19] = new MenuItem("Dinner", "Porkchops",14.50);
- for (int i = 0; i < 20; i++)
- {
- if (MenuItem.type == "Breakfast")
- {
- BreakfastView.Items.Add(newItems[i]);
- }
- else
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement