I checked the solution you sent me and apparently it seems to fit with my needs but I am not really sure I got it perfectly. I need you to confirm some facts.
My application is built with:
- A MainWindow (a view with it's own ViewModel) that contains a RadTabControl
- I need to make each tab of the RadTabControl the host for a different View/ViewModel (each view is a UserControl who contains different controls)
Do you confirm that all i have to do is:
- To add a "TabsList" property (ObservableCollection<ViewModelBase>) to my MainWindowViewModel ?
- To create a DataTemplateSelector (and bind it to my RadTabControl) to pick the right template (a view) for each ViewModel in the TabsList ?
- To bind the ItemsSource property of my RadTabControl to the TabsList of the MainWindowViewModel ?
- To add a ViewModel instance to TabsList everytime i need to add a TabItem to my RadTabControl ?
- To remove an instance of a ViewModel in TabsList everytime i want to remove a TabItem in my RadTabControl ?
Am I doing right or I misunderstood your answer and how to use the DataTemplateSelector with the RadTabControl and MVVMLight. Thanks a lot for your help :)