I have a wpf app that shows 5 different usercontrols as you go through the system. Each usercontrol has a listbox on it. So i want to select an item and pass it back to MainViewModel. I have it working now so that i can store a value in ViewModelBase but it seems that my tactic for calling the User controls is flawed as I cant link up to each individual ViewModel but only to ViewModelBase. I understand where Im going wrong but I wonder is there a way to do this by initialising each Usercontrol seperately and not just off the viewModelBase as i do here:
private ViewModelBase _control;
public ViewModelBase Control
{
get { return _control; }
set
{
_control = value;
OnPropertyChanged("Control");
}
}
and then i say on loaded
Control = new MainScreenViewModel();
ynd = new YesNoDelegate(YesNoNavigation);
Control.SetReturnData(ynd);
Control.name = "MainScreen";
control is then called in xaml like
<ContentControl Content="{Binding Control}" Height="350" Width="525" Grid.Column="1"/>
any help would be appriciated Greatly.
Thanks.