/// <summary> /// Hook into navigation event /// </summary> /// <param name="e">View navigation args</param> public void HandleEvent(ViewNavigationArgs e) { if (e.Deactivate) { ViewModelRouter.DeactivateView(e.ViewType); EventAggregator.Publish(new ViewNavigatedArgs(e.ViewType) { Deactivate = true }); return; } // does a view location exist? var viewLocation = (from location in _fluentRoutes where location.ViewName.Equals(e.ViewType, StringComparison.InvariantCultureIgnoreCase) select location).FirstOrDefault() ?? (from location in ViewLocations where location.ViewName.Equals(e.ViewType, StringComparison.InvariantCultureIgnoreCase) select location).FirstOrDefault(); // if so, try to load the xap, then activate the view if (viewLocation != null) { DeploymentService.RequestXap(viewLocation.ViewXap, exception => { if (exception != null) { throw exception; } _ActivateView(e.ViewType, e.ViewParameters); }); } else { // just activate the view directly _ActivateView(e.ViewType, e.ViewParameters); } }