public void Navigate(Type targetPageType, object parameter) { if (provider.CanNavigate(targetPageType)) { provider.Navigate(targetPageType, parameter); } }
private void SubscribeToChanges <TView, TViewModel>(RegistredView <TView, TViewModel> view) where TView : class, IView where TViewModel : class, INotifyPropertyChanged, IActivable { var disposable = view.ViewModel.ObservePropertyChange(x => x.IsActive).Where(x => x).Subscribe((x) => { navigationProvider.Navigate(view); }, err => throw err); if (!ActivateSubscriptions.TryGetValue(view, out var subscription)) { ActivateSubscriptions.Add(view, disposable); } else { subscription.Dispose(); ActivateSubscriptions[view] = disposable; } }