コード例 #1
0
        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;
        }
コード例 #2
0
 protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     if (e.Parameter != null)
     {
         ((MainViewModel)DataContext).TextToDisplay = e.Parameter.ToString();
     }
 }
コード例 #3
0
 protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;
     SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
     LoadSettings();
 }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
        protected override async void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            await Task.Delay(1800);

            this.Frame.Navigate(typeof(ControlPages.ProgressBarPage));
        }
コード例 #6
0
 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();
         }
     }
 }
コード例 #7
0
 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);
     }
 }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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();
                }
            }
        }
コード例 #10
0
 private void SetCurrentUrl(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         Element.CurrentUrl = e.Uri.ToString();
     });
 }
コード例 #11
0
        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;
        }
コード例 #12
0
        protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
            ViewModel.OnNavigateFrom();

            SettingsPane.GetForCurrentView().CommandsRequested -= OnCommandsRequested;
        }
コード例 #13
0
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            // ok...
            this.GetModel().Activated();
        }
コード例 #14
0
        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;
            }
        }
コード例 #15
0
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e); // TODO: key not found exception
            ViewModel.OnNavigateTo();

            SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
        }
コード例 #16
0
        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;
                    }
                }
            }
        }
コード例 #17
0
 protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     ClearBackStack();
     InformationView.Reset();
     SearchResultsView.Reset();
 }
コード例 #18
0
        protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            var dtm = DataTransferManager.GetForCurrentView();

            dtm.DataRequested -= dtm_DataRequested;
        }
コード例 #19
0
ファイル: Shell.xaml.cs プロジェクト: egartley/site-manager
 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";
     }
 }
コード例 #20
0
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var animation = (Storyboard)this.Resources["TextBlockAnimation"];

            animation.Begin();
        }
コード例 #21
0
        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;
        }
コード例 #22
0
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var accessToken = (string)e.Parameter;

            _fb = new FacebookClient(accessToken);
        }
コード例 #23
0
 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}");
     }
 }
コード例 #24
0
        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();
        }
コード例 #25
0
 protected async override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     if (AnalyticsInfo.VersionInfo.DeviceFamily != "Windows.Desktop")
     {
         await StartScanner();
     }
     base.OnNavigatedTo(e);
 }
コード例 #26
0
 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;
 }
コード例 #27
0
 protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (ViewModel != null && ViewModel is FirstViewModel)
     {
         ((FirstViewModel)ViewModel).CargarContactos();
     }
 }
コード例 #28
0
        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;
        }
コード例 #29
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;
     }
 }
コード例 #30
0
        /// <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;
        }
コード例 #31
0
ファイル: MainPage.xaml.cs プロジェクト: jakkaj/Xamling-Core
        /// <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.
        }
コード例 #32
0
 /// <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;
 }