I have a model with nested data like so:
public class Employees
{
public string Name { get; set; }
public List<Customers> Customers { get; set; }
}
public class Customers
{
public string CustName { get; set; }
public string CustAddress { get; set; }
}
I would like to use MVVM to populate an Accordion View or Listview only with the Header being the Employees/Name, and the content being Customers/CustName for every Customer.
(1) Can the model collection be List or does it need to be of type ObservableCollection, including the nested Customers?
(2) I think I can achieve this by using and Accordion View and setting the Header to the Employees/Name, and the content to the nested List, but I haven't been successful with displaying the nested data. Can you show a small sample?
(3) The entire thing can be achieved by using only the ListView and setting the GroupHeader to Employees/Name and the Content to the nested Customers right? I have not been successful in showing the open/close button in this case for each of the groups. Can you show a small sample?
Thank you