private void NavigationService_Navigated(object sender, RegionNavigationEventArgs e) { if (e.Uri.ToString().Contains("Results")) { _toggleButtons.First(i => i.Name.Equals("ResultsToggleButton")).IsChecked = true; } }
/// <summary> /// Navigated event from NavigationService /// </summary> /// <param name="sender">sender</param> /// <param name="e">args</param> private void NavigationServiceNavigated(object sender, RegionNavigationEventArgs e) { string pathToMatch = e.Uri.ToString(); IsSelected = IsClassNameAMatch(pathToMatch, ViewType) || ChildViews.Any(x => IsClassNameAMatch(pathToMatch, x)); }
void NavigationService_Navigated(object sender, RegionNavigationEventArgs e) { //Example of implementation //Check if we have open the policy search view if (e.NavigationContext.Uri.ToString() == Policy.Search.Contracts.Views.ViewContractNames.POLICY_SEARCH_VIEW) { //Example of logic should be refactored out in implementation..... or consume other services //Check if we have a menu item "About" if (applicationMenuViewModel.ContainsMenuItem(ABOUT_MENU_NAME)) { //If is visible if (applicationMenuViewModel.IsMenuItemVisible(ABOUT_MENU_NAME)) { //hide it applicationMenuViewModel.HideMenuItem(ABOUT_MENU_NAME); } else { //show it applicationMenuViewModel.ShowMenuItem(ABOUT_MENU_NAME); } } } }
/// <summary> /// Handles the Navigated event of the NavigationService control. /// This method populates the non-linear navigation collection each time the region is navigated. /// Notice how the <see cref="INonLinearNavigationObject"/> is consumed below. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.Practices.Prism.Regions.RegionNavigationEventArgs"/> instance containing the event data.</param> void NavigationService_Navigated(object sender, RegionNavigationEventArgs e) { _logger.Log(Global.RegionNavigatedTo + e.Uri); this.InstantiatedViews.Clear(); foreach (var item in _regionManager.Regions[RegionNames.MainContentRegion].Views) { var nonLinearNavigationObject = item as INonLinearNavigationObject; if (nonLinearNavigationObject != null) { this.InstantiatedViews.Add(new NonLinearNavigationMetadata(nonLinearNavigationObject)); } else { var fwe = item as FrameworkElement; if (fwe != null) { nonLinearNavigationObject = fwe.DataContext as INonLinearNavigationObject; if (nonLinearNavigationObject != null) { this.InstantiatedViews.Add(new NonLinearNavigationMetadata(nonLinearNavigationObject)); } } } } }
private void OnNavigated(object sender, RegionNavigationEventArgs e) { _eventAggregator.GetEvent <ApplicationEvents.Navigated>().Publish(new ApplicationEvents.Navigated.NavigationInfo { RegionName = e.NavigationContext.NavigationService.Region.Name, Parameter = e.NavigationContext.Parameters[AppGlobals.NavigationParameterKey], ViewName = e.NavigationContext.Uri.OriginalString }); }
void OnNavigated(object sender, RegionNavigationEventArgs e) { SearchText = string.Empty; _navigationService.ReportNavigation(e.Uri); //((DelegateCommand)OnHomeCommand).RaiseCanExecuteChanged(); ((DelegateCommand)OnBackCommand).RaiseCanExecuteChanged(); ((DelegateCommand)OnForwardCommand).RaiseCanExecuteChanged(); }
private void NavigationService_Navigated(object sender, RegionNavigationEventArgs e) { SetViewInfo(); if (_currentView != null) { _currentView.Journal = e.NavigationContext.NavigationService.Journal; this.PopWindowInfo.IsUp = _currentView.Journal.CanGoBack; this.PopWindowInfo.IsNext = _currentView.Journal.CanGoForward; } }
private void NavigationServiceOnNavigating(object sender, RegionNavigationEventArgs regionNavigationEventArgs) { if (regionNavigationEventArgs.NavigationContext.Uri.OriginalString != ViewNames.StartView) { return; } var s = (FrameworkElement)_container.Resolve <object>(regionNavigationEventArgs.NavigationContext.NavigationService.Journal.CurrentEntry.Uri.OriginalString); var rtb = new RenderTargetBitmap((int)s.ActualWidth, (int)s.ActualHeight, 96, 96, PixelFormats.Pbgra32); rtb.Render(s); OverlayImage = rtb; }
private void OnViewRegionNavigating(object sender, RegionNavigationEventArgs e) { var region = RegionManager.Regions[AppRegions.MainRegion]; var entry = region.NavigationService.Journal.CurrentEntry; if (entry != null) { if (entry.Uri.OriginalString.Contains(typeof(NowPlayingView).FullName)) { region.NavigationService.Journal.GoBack(); } } }
private void OnNavigated(object sender, RegionNavigationEventArgs e) { var item = MenuItems .OfType <HamburgerMenuItem>() .FirstOrDefault(i => e.Uri.ToString() == i.Tag?.ToString()); if (item != null) { SelectedMenuItem = item; } GoBackCommand.RaiseCanExecuteChanged(); }
private void HandleNavigated(object sender, RegionNavigationEventArgs e) { currentUri = e.Uri.ToString(); if (topPages.Contains(currentUri)) { IsBackEnabled = false; BackButtonVisible = NavigationViewBackButtonVisible.Collapsed; } else { IsBackEnabled = true; BackButtonVisible = NavigationViewBackButtonVisible.Visible; } }
/// <summary> /// Handles the Navigated event of the NavigationService. /// /// This method also scrolls the DataGrid to the last item after each /// navigation request is completed /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Microsoft.Practices.Prism.Regions.RegionNavigationEventArgs"/> instance containing the event data.</param> void NavigationService_Navigated(object sender, RegionNavigationEventArgs e) { this.Logger.Log(Global.RegionNavigatedTo + e.Uri.ToString()); //HACK how to scroll a DataGrid to the last item if (dg.Items.Count > 0) { var border = VisualTreeHelper.GetChild(dg, 0) as Decorator; if (border != null) { var scroll = border.Child as ScrollViewer; if (scroll != null) { scroll.ScrollToEnd(); } } } }
private void OnNavigated(object sender, RegionNavigationEventArgs e) { var item = MenuItems .OfType <HamburgerMenuItem>() .FirstOrDefault(i => e.Uri.ToString() == i.Tag?.ToString()); if (item != null) { } //{[{ else { SelectedOptionsMenuItem = OptionMenuItems .OfType <HamburgerMenuItem>() .FirstOrDefault(i => e.Uri.ToString() == i.Tag?.ToString()); } //}]} }
private void mediaFileBrowserContentRegion_Navigated(object sender, RegionNavigationEventArgs e) { if (MediaFileBrowserViewModel == null) { return; } if (e.Uri.ToString().StartsWith(typeof(MediaFileGridView).FullName)) { MediaFileBrowserViewModel.ExpandCommand.IsExecutable = true; MediaFileBrowserViewModel.ContractCommand.IsExecutable = false; } else { MediaFileBrowserViewModel.ExpandCommand.IsExecutable = false; MediaFileBrowserViewModel.ContractCommand.IsExecutable = true; } }
private void NavigationServiceOnNavigated(object sender, RegionNavigationEventArgs e) { var active = e.NavigationContext.NavigationService.Region.ActiveViews.FirstOrDefault() as FrameworkElement; if (active != null) { IRadioStation radioStation = active as IRadioStation; if (radioStation == null) { radioStation = active.DataContext as IRadioStation; } if (radioStation != null) { radioStation.OnTuneIn(e.NavigationContext); } } }
private void mediaFileBrowserContentRegion_Navigating(object sender, RegionNavigationEventArgs e) { if (MediaFileBrowserViewModel == null || RegionManager.Regions[RegionNames.MediaFileBrowserContentRegion].NavigationService.Journal.CurrentEntry == null) { return; } Uri currentUri = RegionManager.Regions[RegionNames.MediaFileBrowserContentRegion].NavigationService.Journal.CurrentEntry.Uri; if (currentUri.ToString().StartsWith(typeof(VideoView).FullName)) { MediaFileBrowserViewModel.NavigateBackCommand = MediaFileBrowserViewModel.NavigateToVideoViewCommand; } else if (currentUri.ToString().StartsWith(typeof(ImageView).FullName)) { MediaFileBrowserViewModel.NavigateBackCommand = MediaFileBrowserViewModel.NavigateToImageViewCommand; } else { MediaFileBrowserViewModel.NavigateBackCommand = MediaFileBrowserViewModel.NavigateToMediaFileGridCommand; } }
private void NavigationServiceOnNavigating(object sender, RegionNavigationEventArgs e) { _navigationParameters = e.NavigationContext.Parameters; }
private void ContentRegionNavigatedEvent(object sender, RegionNavigationEventArgs e) { NavigateBackCommand.RaiseCanExecuteChanged(); NavigateForwardCommand.RaiseCanExecuteChanged(); }
private void NavigationServiceOnNavigated(object?sender, RegionNavigationEventArgs e) { this.SelectedView = e.Uri.OriginalString; }
void NavigationService_Navigating(object sender, RegionNavigationEventArgs e) { this.Logger.Log(Global.RegionNavigatingTo + e.Uri.ToString()); }
public void MainContentRegion_Navigated(object sender, RegionNavigationEventArgs e) { _lastUri = e.Uri; OnClickCommand.RaiseCanExecuteChanged(); }
private void Mainregion_Navigated(object sender, RegionNavigationEventArgs e) { UpdateNavigationButtonState(e.Uri); }
/// <summary> /// Handles the <see cref="IRegionNavigationService.Navigated"/> event. /// It is used to update the <see cref="GoBackCommand"/>'s and <see cref="GoForwardCommand"/>'s /// <see cref="DelegateCommand.CanExecute"/> state. /// </summary> /// <param name="sender"><see cref="NavigationService"/>.</param> /// <param name="e">Navigation event args.</param> private void NavigationService_Navigated(object sender, RegionNavigationEventArgs e) { GoBackCommand.RaiseCanExecuteChanged(); GoForwardCommand.RaiseCanExecuteChanged(); }
void NavigationService_Navigated(Object sender, RegionNavigationEventArgs e) { _inventoryNavigatedEvent.Publish(e.Uri.ToString()); }
public void MainContentRegion_Navigated(object sender, RegionNavigationEventArgs e) { }
protected virtual void RegionOneNavigationServiceOnNavigating(object sender, RegionNavigationEventArgs e) { }
protected virtual void RegionOneNavigationServiceOnNavigated(object sender, RegionNavigationEventArgs e) { this.CanGoBack = e.NavigationContext.NavigationService.Journal.CanGoBack; this.CanGoForward = e.NavigationContext.NavigationService.Journal.CanGoForward; }
private void OnNavigated(object sender, RegionNavigationEventArgs e) { var page = _regionManager.Regions[Regions.Main].ActiveViews.First() as UserControl; UpdateTabs(page); }
public void MainContentRegion_Navigated(object sender, RegionNavigationEventArgs e) { this.UpdateNavigationButtonState(e.Uri); }
private void OnNavigated(object sender, RegionNavigationEventArgs e) => GoBackCommand.RaiseCanExecuteChanged();