I have a View with several DataTemplates. Each DataTemplate has a View and ViewModel like so:
<DataTemplate DataType="{x:Type viewModels:exampleViewModel}">
<AdornerDecorator>
<ScrollViewer>
<views:exampleView />
</ScrollViewer>
</AdornerDecorator>
</DataTemplate>
Then I have a TabControl which is bound to a DataContext.
In the DataContext, there is a Collection which has a list of all the different viewModels referenced by the DataTemplates:
<TabControl
DataContext="{Binding}"
ItemsSource="{Binding Collection, Mode=OneWay}">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding}" />
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
Obviously there is one 'main' ViewModel for the View that contains the TabControl.
This works pretty well, creating TabItems for me for each item in the Collection and also setting the content of each page.
I now want to move this over to Catel but have no idea on where to begin because (and correct me if I'm wrong) :
I now should not have any reference to any other ViewModel within any ViewModel and
Catel automatically will link up my Views and ViewModels for me.
Any suggestions?