public NavigationService( Frame frame, IPageDefinitionRegistry pageDefinitions, IViewModelFactory viewModelFactory, IScheduler dispatcherScheduler, IScheduler backgroundScheduler) { if (frame == null) throw new ArgumentNullException("frame"); if (pageDefinitions == null) throw new ArgumentNullException("pageDefinitions"); if (viewModelFactory == null) throw new ArgumentNullException("viewModelFactory"); if (dispatcherScheduler == null) throw new ArgumentNullException("dispatcherScheduler"); if (backgroundScheduler == null) throw new ArgumentNullException("backgroundScheduler"); _frame = frame; _pageDefinitions = pageDefinitions; _viewModelFactory = viewModelFactory; _dispatcherScheduler = dispatcherScheduler; _backgroundScheduler = backgroundScheduler; _navigatingSubject = new Subject<INavigationRequest>(); _navigatedSubject = new Subject<INavigationRequest>(); _semaphore = new SemaphoreSlim(1); History = _history = new NavigationHistory(RemoveHistoryEntry, ClearHistory); _frame.Navigated += _frame_Navigated; //_frame.BackKeyPress += _frame_BackKeyPress; }