public void LoadModel(ChildViewModel viewModel)
 {
     UnloadCurrentViewModel();
     viewModel.MainViewModel = this;
     CurrentViewModel = viewModel;
     viewModel.OnLoaded();
 }
 public void NavigateTo(ChildViewModel viewModel)
 {
     if (MainViewModel == null)
     {
         throw new NullReferenceException("ChildViewModel must have MainViewModel defined, " +
                                          "it's done by default when using MainViewModel to load it. " +
                                          "Consider doing this or assign MainViewModel manually.");
     }
     viewModel.MainViewModel = MainViewModel;
     MainViewModel.LoadModel(viewModel);
 }
 public void LoadChildrenViewModel(ChildViewModel viewModel)
 {
     LoadViewModel(viewModel);
 }
 private void UnloadCurrentViewModel()
 {
     if (CurrentViewModel != null)
     {
         CurrentViewModel.OnUnloaded();
         CurrentViewModel = null;
     }
 }
 protected void LoadViewModel(ChildViewModel viewModel)
 {
     MainViewModel.LoadModel(viewModel);
 }