public void Execute(object parameter) { if (parameter is ViewType viewType) { _navigator.CurrentViewModel = _rootViewModelFactory.CreateViewModel(viewType); } }
public void Execute(object parameter) { if (parameter is ViewType) { var viewType = (ViewType)parameter; _navigator.CurrentViewModel = _viewModelFactory.CreateViewModel(viewType); } }
// Constructors #region Constructors public ShellViewModel(INavigator navigator, IRootViewModelFactory viewModelFactory) { _navigator = navigator; _navigator.StateChanged += Navigator_StateChanged; _navigator.CurrentViewModel = viewModelFactory.CreateViewModel(ViewType.Home); UpdateCurrentViewModelCommand = new UpdateCurrentViewModelCommand(_navigator, viewModelFactory); CloseApplicationCommand = new RelayCommand(CloseApplication); }