protected bool SwitchView(Type viewType) { ContainerChildViewModelBase oldView = _selectedView; foreach (ContainerChildViewModelBase view in _views) { var masterVM = view as ContainerViewModelBase; if (view.GetType() == viewType) { if (Set(() => SelectedView, ref _selectedView, view)) { OnSelectedViewChanged(oldView, _selectedView); } return(true); } if (masterVM != null && masterVM.SwitchView(viewType)) { if (Set(() => SelectedView, ref _selectedView, view)) { OnSelectedViewChanged(oldView, _selectedView); } return(true); } } return(false); }
protected virtual void OnSelectedViewChanged(ContainerChildViewModelBase oldView, ContainerChildViewModelBase newView) { if (oldView != null) { oldView.IsSelected = false; } newView.IsSelected = true; }
protected virtual void OnSelectedViewChanged(ContainerChildViewModelBase oldView, ContainerChildViewModelBase newView) { if (oldView != null) oldView.IsSelected = false; newView.IsSelected = true; }