View Models:
public class Notes : BaseViewModel { public string Header { get; set; } public ObservableCollection<string> NoteLines { get; } } public class SomePage : BaseViewModel { public Notes Notes { get; set; } } Datatemplate:
<DataTemplate DataType="local:Notes"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <TextBlock Grid.Row="0" Text="{Binding Header}"/> <ItemsControl Grid.Row="1" ItemsSource="{Binding NoteLines}"/> </Grid> </DataTemplate> <DataTemplate DataType="local:SomePage"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <SomeElement Grid.Column="0"/> <SomeElement Grid.Column="1"/> <!-- тут какой то способ отобразить Notes --> </Grid> </DataTemplate> I do not understand how to display the Notes property and how, for example, to display an instance of SomePage .
Plus, not sure, but how will the DataContext be transmitted?
