I have a user control on a page and I’d like to load another custom user control within it’s grid. However I want the user control type to be dynamic – e.g selecting “Calculator” from a drop down list would display my custom calculator control and selecting “Currency Converter” would load my currency converter. Can anybody help?
By the way I am trying to stick to MVVM.
Thanks in advance.
One way is to define multiple
DataTemplatesone for each child. As user selects the option set the correspondingViewModelto aContentControl's DataContextpresent in parent view and framework will pick the corresponding view for you.