When a user clicks the item or items in the main page listview I need to take the data and pass it to a second array which will go to a checkout on the next page.I cant figure out how to pass data from 1 listview to another listview between pages.
public struct DATA
{
public DATA(string distinguisher, double price, string description)
{
Distinguisher = distinguisher;
Price = price;
Description = description;
}
public string Distinguisher { get; }
public double Price { get; }
public string Description { get; }
}
public MainPage()
{
InitializeComponent();
}
public void btnBreakfast_Click(object sender)
{
//20 Elements for the Array
DATA[] myData = new DATA[20]
{
new DATA("Breakfast", 4.00 , "Gourment Pancakes"),
new DATA("Breakfast", 6.00 , "Eggs & Toast"),
new DATA("Breakfast", 7.50 , "Oatmeal with OJ"),
new DATA("Breakfast", 10.75 , "Fresh Waffles"),
new DATA("Breakfast", 11.00 , "Bacon Egg & Cheese"),
new DATA("Breakfast", 4.00 , "Bagel & Cream Cheese"),
new DATA("Breakfast", 4.00 , "Butter Potatoes with Toast"),
new DATA("Lunch", 9.50 , "Tuna Fish"),
new DATA("Lunch", 8.00 , "Ham & Cheese"),
new DATA("Lunch", 14.00 , "Buffalo Chicken Wrap"),
new DATA("Lunch", 13.00 , "Cheeseburger with Fries"),
new DATA("Lunch", 6.00 , " Jumbo Cheese Pizza"),
new DATA("Lunch", 9.00, "Hotdog with Fries"),
new DATA("Lunch", 9.00, "Philly Cheese Stake"),
new DATA("Dinner", 22.00, "Salmon with Two Sides"),
new DATA("Dinner", 24.00, "Steak with Two Sides"),
new DATA("Dinner", 17.00, "Chicken Parm Dinner"),
new DATA("Dinner", 25.00, "Extra Large Lasagna"),
new DATA("Dinner", 15.00, "Stuffed Shells"),
new DATA("Dinner", 16.00, "Penne Ala Vodka"),
};
for (int i = 0; i < myData.Length; i++)
{
if (myData[i].Distinguisher == "Breakfast")
{
HomePageListBox.Items.Add(myData[i].Description);
}
}
}