I have three nested classes: Show, Season and Episode, where the show has seasons and the seasons have episodes.
I want to link the two lists to the first list of seasons, and the second list of episodes this season.
How can i do this? I prefer to install this in code rather than in xaml, but if you know how to do it with xaml, this is better than nothing ..
Simplified xaml:
<Window>
<Label name="Showname" />
<ListBox name="Seasons" />
<ListBox name="Episodes" />
</Window>
and some code:
public partial class Window1 : Window
{
public Data.Show show { get; set; }
public Window1()
{
this.DataContex = show;
Binding bindName = new Binding("Name");
ShowName.SetBinding(Label.ContentProperty, bindName);
Binding bindSeasons = new Binding("Seasons");
Seasons.SetBinding(ListBox.ItemsSourceProperty, bindSeasons);
Seasons.DisplayMemberPath = "SeasonNumber";
Seasons.IsSyncronizedWithCurrentItem = true;
Binding bindEpisodes = new Binding("?????");
Episodes.SetBinding(ListBox.ItemsSourceProperty, bindEpisodes);
Episodes.DisplayMemberPath = "EpisodeTitle";
}
}
Has anyone figured out how to link the second list?
Vegar source
share