protected async override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs args) { NotCloseableTab.Visibility = Visibility.Collapsed; await Task.Delay(TimeSpan.FromMilliseconds(1)); NotCloseableTab.Visibility = Visibility.Visible; }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (e.Parameter != null) { ((MainViewModel)DataContext).TextToDisplay = e.Parameter.ToString(); } }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape; SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested; LoadSettings(); }
private void OnFrameNavigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (sender is Frame frame && frame.Content is FrameworkElement element && element.DataContext is IBackNavigationHandler backNavigationHandler) { backNavigationHandler.OnPageCanGoBackChanged += OnPageCanGoBackChanged; } }
protected override async void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); await Task.Delay(1800); this.Frame.Navigate(typeof(ControlPages.ProgressBarPage)); }
private async void Frame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (e.SourcePageType == typeof(LibraryView)) { if (e.Parameter.ToString() == "Recent") { ChangeView("Recently Played", false, RecentlyPlayedCollection); } else { ChangeView("Music Library", libgrouped, TracksCollection.Elements); } await RefreshSourceAsync().ConfigureAwait(false); } else { AlbumArtistVM.AlbumCollection = null; if (ViewSource.Source != null) { source = ViewSource.Source; grouped = ViewSource.IsSourceGrouped; ViewSource.Source = null; GC.Collect(); } } }
private void OnNavigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (NavigationTargets.Any(x => x.TargetType == e.SourcePageType)) { SelectedNavigationTarget = NavigationTargets.Single(x => x.TargetType == e.SourcePageType); } }
protected internal void View_NavigatedCore(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (e != null) { if (CurrentChild != null) { CurrentChild.InvokeOnNavigatedFrom(e); CurrentChild.Cleanup(); CurrentChild = null; } MemoryCheck(); Type key = e.Content.GetType(); var child = Children[key]; var element = e.Content as FrameworkElement; child.Parent = this; child.ViewBase = element; CurrentChild = child; child.Initialize(); child.InvokeOnNavigatedTo(e); } }
private async void Frame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { string param = (e.Parameter ?? String.Empty).ToString(); // e.Parameter can be null and throw exception if (e.SourcePageType == typeof(LibraryView)) { if (param == "Recent") { ChangeView("Recently Played", false, RecentlyPlayedCollection); } else { ChangeView("Music Library", libgrouped, TracksCollection.Elements); } await RefreshSourceAsync().ConfigureAwait(false); } else { if (ViewSource.Source != null) { source = ViewSource.Source; grouped = ViewSource.IsSourceGrouped; ViewSource.Source = null; GC.Collect(); } } }
private void SetCurrentUrl(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { Device.BeginInvokeOnMainThread(() => { Element.CurrentUrl = e.Uri.ToString(); }); }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter == null) { throw new InvalidOperationException($"Cannot navigate to {nameof(FormsEmbeddedPageWrapper)} without " + $"providing a {nameof(Xamarin.Forms.Page)} identifier."); } // Find the page instance in the dictionary and then discard it so we don't prevent it from being collected var key = (Guid)e.Parameter; var page = Pages[key]; Pages.Remove(key); // Convert that page into a FrameWorkElement we can display in the ContentPresenter FrameworkElement frameworkElement = page.CreateFrameworkElement(); if (frameworkElement == null) { throw new InvalidOperationException($"Could not find or create a renderer for the Page {page}"); } Root.Content = frameworkElement; }
protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedFrom(e); ViewModel.OnNavigateFrom(); SettingsPane.GetForCurrentView().CommandsRequested -= OnCommandsRequested; }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); // ok... this.GetModel().Activated(); }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); var rootFrame = Windows.UI.Xaml.Window.Current.Content as Windows.UI.Xaml.Controls.Frame; if (rootFrame == null) { return; } var navm = Windows.UI.Core.SystemNavigationManager.GetForCurrentView(); if (rootFrame.CanGoBack) { navm.AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Visible; navm.BackRequested += (sender, be) => { if (rootFrame.CanGoBack && be.Handled == false) { be.Handled = true; rootFrame.GoBack(); } }; } else { navm.AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Collapsed; } }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); // TODO: key not found exception ViewModel.OnNavigateTo(); SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested; }
private void HamburgerFrame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (_observedContainer != null) { _observedContainer.SizeChanged -= ObservedContainer_SizeChanged; _observedContainer = null; } var page = e.Content as Page; if (page != null) { var observedContainer = page.Content as FrameworkElement; if (observedContainer != null) { observedContainer.SizeChanged += ObservedContainer_SizeChanged; ResetInternalMargin(page, observedContainer); _observedContainer = observedContainer; } } lock (_registeredControlsLock) { foreach (var hamburgerMenuButton in _registeredHamburgerMenuButtons) { if (hamburgerMenuButton.NavigationSourcePageType != null) { hamburgerMenuButton.IsChecked = hamburgerMenuButton.NavigationSourcePageType == e.SourcePageType; } } } }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); ClearBackStack(); InformationView.Reset(); SearchResultsView.Reset(); }
protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedFrom(e); var dtm = DataTransferManager.GetForCurrentView(); dtm.DataRequested -= dtm_DataRequested; }
private void ShellFrame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (e.SourcePageType == typeof(EditWebPage)) { // be able to navigate back to home page from edit web page LastPage = "EditWebPage"; } }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); var animation = (Storyboard)this.Resources["TextBlockAnimation"]; animation.Begin(); }
private void _rootFrame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { var viewModel = (Application.Current as App).ServiceProvider.GetRequiredService(_currentViewModelType) as ViewModelBase; var page = e.Content as Page; page.Loaded += (s, ev) => { viewModel.PrepareViewModelAsync(); }; page.DataContext = viewModel; }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); var accessToken = (string)e.Parameter; _fb = new FacebookClient(accessToken); }
private async void OnContentLoadCompleted(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs args) { if (Logger.LogExtraTiming) { var uri = args.Uri == null ? "null" : args.Uri.ToString(); await Logger.LogAsync($"MainEpubReader:HTML:OnContentLoad Completed: URL={uri}"); } }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); // It is important to call EnableFocusOnKeyboardInput here in the OnNavigatedTo method to // give the previous page's SearchUserControl time to tear down. this.searchUserControl.EnableFocusOnKeyboardInput(); }
protected async override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Desktop") { await StartScanner(); } base.OnNavigatedTo(e); }
private void Rootframe_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { // Each time a navigation event occurs, update the Back button's visibility ////SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = //// ((Frame)sender).CanGoBack ? //// AppViewBackButtonVisibility.Visible : //// AppViewBackButtonVisibility.Collapsed; }
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (ViewModel != null && ViewModel is FirstViewModel) { ((FirstViewModel)ViewModel).CargarContactos(); } }
private void NavigatingBackFromVisitorSearch(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { App.RootFrame.Navigated -= NavigatingBackFromVisitorSearch; var targetPage = (e.Content as NewVisitPage); targetPage.VisitorId = this.visitorId; this.visitorId = 0; }
private void Frame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) { if (e.Content is PdfViewerSource pdfViewer) { pdfViewer.ButtonCloseClicked += OnPdfViewerCloseButtonClicked; pdfViewer.ButtonFavoriteToggled += OnButtonFavoriteToggled; } }
/// <summary> /// Restores the content transitions after the app has launched. /// </summary> /// <param name="sender">The object where the handler is attached.</param> /// <param name="e">Details about the navigation event.</param> private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e) { var rootFrame = sender as Frame; rootFrame.ContentTransitions = transitions ?? new TransitionCollection { new NavigationThemeTransition() }; rootFrame.Navigated -= RootFrame_FirstNavigated; }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { // TODO: Prepare page for display here. // TODO: If your application contains multiple pages, ensure that you are // handling the hardware Back button by registering for the // Windows.Phone.UI.Input.HardwareButtons.BackPressed event. // If you are using the NavigationHelper provided by some templates, // this event is handled for you. }
/// <summary> /// Restores the content transitions after the app has launched. /// </summary> /// <param name="sender">The object where the handler is attached.</param> /// <param name="e">Details about the navigation event.</param> private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e) { var rootFrame = sender as Frame; rootFrame.ContentTransitions = transitions ?? new TransitionCollection {new NavigationThemeTransition()}; rootFrame.Navigated -= RootFrame_FirstNavigated; }