As far as I understand your question, you can solve this by having UC
expose a SelectedSubView
(or whatever) property:
public object SelectedSubView { get; }
At the same time, you bind the radiobuttons to other properties of UC
and update SelectedSubView
accordingly (remember to implement INotifyPropertyChanged). Based on the selected radiobutton properties, the SelectedSubView
must return the appropriate ViewModel.
You then bind a ContentPresenter to the SelectedSubView
property and use DataTemplates to select the correct user controls (uc1, uc2 or uc3) based on the type of the current SelectedSubView
.
Since you only want to hide inactive Views, it's probably best to keep their respective ViewModels around, so you may want to make them fields in the UC
class
public class UC
{
private MyFirstViewModel vm1;
private MySecondViewModel vm2;
private MyThirdViewModel vm3;
private object selectedVM;
public object SelectedSubView
{
get { return this.selectedVM; }
}
// This method should be called whenever one of the radio buttons
// are updated (from their bindings)
private void UpdateSelectedView()
{
this.selectedVM = // pick from vm1, vm2, vm3 according to radio button
// Remember to raise INotifyPropertyChanged for SelectedSubView
}
}