///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
ObservableCollection chapterItm = new ObservableCollection();
public ObservableCollection Chapters
{ get { return chapterItm; } }
private void Window_Loaded(object sender, RoutedEventArgs e)
{
List stringcol1 = new List();
stringcol1.Add("Excercise 1");
stringcol1.Add("Excercise 2");
List stringcol2 = new List();
stringcol2.Add("Excercise 5");
stringcol2.Add("Excercise 6");
List subList1 = new List();
subList1.Add(new BookPage { Name = "Page 1 ", Id = "ID1", Excercises = stringcol1});
subList1.Add(new BookPage { Name = "Page 2", Id = "ID2", Excercises = stringcol2 });
List subList2 = new List();
subList2.Add(new BookPage { Name = "Page 5", Id = "ID 21", Excercises = stringcol1 });
subList2.Add(new BookPage { Name = "Page 6", Id = "ID22", Excercises = stringcol2 });
chapterItm.Add(new BookChapter { Name = "Chapter 1", Pages = subList1});
chapterItm.Add(new BookChapter { Name = "Chapter 2", Pages = subList2 });
}
}
public class BookChapter
{
public string Name { get; set; }
public List Pages { get; set; }
}
public class BookPage
{
public string Id { get; set; }
public string Name { get; set; }
public List Excercises { get; set; }
}