Hi have 2 usercontrol(WPF). I have to load this control according to condition. I have ReadingBookDoubleView.xaml nad ReadingBookDoubleViewpdf.xaml this is my code.
<UserControl.Resources>
<DataTemplate DataType="{x:Type viewModels:ReadingBookDoubleVM}">
<view:ReadingBookDoubleViewPdf/>
</DataTemplate>
<DataTemplate DataType="{x:Type viewModels:ReadingBookDoubleVM}">
<view:ReadingBookDoubleView/>
</DataTemplate>
</UserControl.Resources>
I have book kind in Viewmodel class which is bind to this view where I am loading the user control. i have to load one control at a time.If book Kind is Pdf then I have load ReadingBookDoubleViewpdf control other wise I have to load ReadingBookDoubleView.
how can I load the control according to condition.