I want to show in a ListView, that is declared in XAML, the purchases that a selected customer has made, so I thought of declaring a class where I can store data from each customer and in that class declaring an attribute to store each purchase done, but I cannot find the way to show it properly. I already have some methods to get data input from user, and it's working for my class Customer but once I try to show the Purchase ListView data doesn't appear.
I don't know how to implement the code to show data from each one of the purchases ofin the ListView that I have declared at the XAML
//Main
namespace WpfApp1
{
public partial class MainWindow : Window
{
public ObservableCollection<Customer> lc = new ObservableCollection<Customer>();
//Code
}
}
//Customer.cs
public class Customer
{
public string name {get; set; }
public string surname {get; set;}
public ObservableCollection<Purchase> lp;
}
//Purchase.cs
public class Purchase
{
public DateTime date {get; set;}
public string shop {get; set;}
}