I have a requirement where in I am having a Silverlight Page consisting of Master-Detail View. The Detail Section gets changed dynamically based on a Combo box selection in Master View. I am now using Prism DataTemplateSelector to dynamically load the detail
view based on the Entity Type of Detail.
In my application, I have only one ViewModel (MainViewModel) which will serve as the DataContext for the Master View and all the Detail Views. So when i choose the
Detail View based on the above shown code, the DetailType1 & DetailType2 classes becomes the DataContext for the DetailOneView and DetailTwoViews respectively, even
though I set the DataContext of DetailOneView and DetailTwoView to MainViewModel in the Xaml.cs of both views.
How do i explicitly make the MainViewModel as the DataContext for DetailOneView and DetailTwoView while using DataTemplateSelector.
Any help is appreciated.