I\'m stuck in this problem for days. Never found a solution. So I\'ve a list of items called Country
, in this list I\'ve also another list of items called Lea
I went by the output you want. Please check and tell if this is what you want.
public partial class WinExpander : Window
{
public WinExpander()
{
InitializeComponent();
this.DataContext = new ViewModel();
}
}
public class ViewModel
{
public List Countries { get; set; }
public ViewModel()
{
Countries = new List();
}
}
public class Country
{
public string Name { get; set; }
public List Leagues { get; set; }
public Country()
{
Leagues = new List();
}
}
public class League
{
public string Name { get; set; }
public List Matches { get; set; }
public League()
{
Matches = new List();
}
}
public class Match
{
public string Name { get; set; }
}
XAML
...
You can replace any of the ItemsControl
with ListBox
too.
Another solution using GroupStyle
and ListView
according to user requirements.
...