Exemple #1
0
 public void InvokeNavigated(String url)
 {
     Navigated?.Invoke(url);
 }
 private static void Frame_Navigated(object sender, NavigationEventArgs e) => Navigated?.Invoke(sender, e);
 private void RaiseNavigated(INavigationContext navigationContext)
 {
     Navigated?.Invoke(this, new RegionNavigationEventArgs(navigationContext));
 }
 protected virtual void OnNavigated <T>(T args)
     where T : NavigationArgs
 {
     Navigated?.Invoke(this, new NavigationEventArgs(args));
 }
Exemple #5
0
 void IWebViewController.SendNavigated(WebNavigatedEventArgs args)
 {
     Navigated?.Invoke(this, args);
 }
 protected virtual void RaiseNavigated(object content, NavigationMode mode, string parameter, IDataContext context)
 {
     Navigated?.Invoke(this, new NavigationEventArgs(content, parameter, mode, context));
 }
Exemple #7
0
        public void HandleNavigated(ShellNavigatedEventArgs args)
        {
            _waitingForWindow?.Dispose();
            _waitingForWindow = null;

            // we don't want to fire Navigated until shell is attached to an actual window
            if (_shell.Window == null || _shell.CurrentPage == null)
            {
                _shell.PropertyChanged += WaitForWindowToSet;
                var shellContent = _shell?.CurrentItem?.CurrentItem?.CurrentItem;

                if (shellContent != null)
                {
                    shellContent.ChildAdded += WaitForWindowToSet;
                }

                _waitingForWindow = new ActionDisposable(() =>
                {
                    _shell.PropertyChanged -= WaitForWindowToSet;
                    if (shellContent != null)
                    {
                        shellContent.ChildAdded -= WaitForWindowToSet;
                    }
                });

                void WaitForWindowToSet(object sender, EventArgs e)
                {
                    if (_shell.Window != null &&
                        _shell.CurrentPage != null)
                    {
                        _waitingForWindow?.Dispose();
                        _waitingForWindow = null;

                        _shell.CurrentItem?.SendAppearing();
                        HandleNavigated(args);
                    }
                }

                return;
            }

            if (AccumulateNavigatedEvents)
            {
                if (_accumulatedEvent == null)
                {
                    _accumulatedEvent = args;
                }
            }
            else
            {
                _accumulatedEvent = null;
                BaseShellItem baseShellItem = _shell.CurrentItem?.CurrentItem?.CurrentItem;

                if (baseShellItem != null)
                {
                    baseShellItem.OnAppearing(() =>
                    {
                        FireNavigatedEvents(args, _shell);
                    });
                }
                else
                {
                    FireNavigatedEvents(args, _shell);
                }

                void FireNavigatedEvents(ShellNavigatedEventArgs a, Shell shell)
                {
                    Navigated?.Invoke(this, args);
                    // reset active page route tree
                    Routing.ClearImplicitPageRoutes();
                    Routing.RegisterImplicitPageRoutes(_shell);
                }
            }
        }
 // Invoke the Changed event; called whenever list changes:
 protected virtual void OnNavigated(NavigationEventArgs e) => Navigated?.Invoke(this, e);
 private void RaiseNavigated(NavigationEventArgs e)
 {
     Navigated?.Invoke(this, e);
 }
 private void Frame_Navigated(object sender, NavigationEventArgs e)
 {
     Navigated?.Invoke(sender, e);
 }
 public void RaiseNavigated(NavigatedEventArgs args)
 {
     Navigated?.Invoke(this, args);
 }
 protected virtual void RaiseNavigated(object page, string parameter, NavigationMode mode, IDataContext context)
 {
     Navigated?.Invoke(this, new Models.EventArg.NavigationEventArgs(page, parameter, mode, context));
 }
Exemple #13
0
 protected virtual void OnNavigated(NavigatedEventArgs e)
 {
     Navigated?.Invoke(this, e);
 }
Exemple #14
0
 public virtual void OnNavigated(NavigationEventArgsBase e)
 {
     Navigated?.Invoke(this, e);
 }
Exemple #15
0
 public virtual void OnNavigated(WebViewNavigatedEventArgs args)
 {
     Navigated?.Invoke(this, args);
 }
Exemple #16
0
 public void NavigateMenuItem(NavigationPath navigationPath)
 {
     _navigationService.NavigatePath(navigationPath);
     Navigated?.Invoke(this, new NavigationServiceEventArgs(_navigationService.Title));
 }
 protected virtual void RaiseNavigated(INavigationContext ctx)
 {
     Navigated?.Invoke(this, new NavigatedEventArgs(ctx));
 }
Exemple #18
0
 private void ComeBack_Click(object sender, RoutedEventArgs e)
 {
     Navigated.GoToAuthPage();
 }
 //[Obsolete]
 internal void RaiseNavigated(Portable.NavigatedEventArgs e) => Navigated?.Invoke(this, e);
Exemple #20
0
 private void RaiseNavigated(NavigationEventArgsBase args)
 {
     Navigated?.Invoke(this, args);
 }
Exemple #21
0
 public void SendNavigated(WebNavigatedEventArgs args)
 {
     Navigated?.Invoke(this, args);
 }
Exemple #22
0
 /// <summary>
 /// Send the Navigated event
 /// </summary>
 /// <param name="args"></param>
 internal void SendNavigated(WebNavigatingEventArgs args)
 {
     Navigated?.Invoke(this, args);
 }
Exemple #23
0
 public static void Navigate(object sender, string to)
 {
     Navigated?.Invoke(sender, new NavigateEventArgs {
         To = to
     });
 }
Exemple #24
0
 public void RaiseNavigated(Portable.NavigatedEventArgs e)
 {
     Navigated?.Invoke(this, e);
     // for backwards compat
     FrameFacade.RaiseNavigated(e);
 }
Exemple #25
0
 private void OnNavigated(object sender, NavigationEventArgs args)
 {
     Navigated?.Invoke(this, new NavigationEventArgsWrapper(args, _lastMode.ToNavigationMode()));
 }
Exemple #26
0
 protected virtual void RaiseNavigated(NavigationEventArgs args)
 {
     Navigated?.Invoke(this, args);
 }
 private void OnNavigated(NavigatedEventArgs e)
 {
     Navigated?.Invoke(this, e);
 }
 private void RaiseNavigated(string pageKey, string parameter)
 => Navigated?.Invoke(this, new NavigationEventArgs(pageKey, parameter));
Exemple #29
0
        private bool InnerNavigate(PageStackEntry entry, NavigationMode mode)
        {
            try
            {
                // Navigating
                var navigatingFromArgs = new NavigatingCancelEventArgs(
                    mode,
                    entry.NavigationTransitionInfo,
                    entry.Parameter,
                    entry.SourcePageType
                    );

                Navigating?.Invoke(this, navigatingFromArgs);

                if (navigatingFromArgs.Cancel)
                {
                    // Frame canceled
                    OnNavigationStopped(entry, mode);
                    return(false);
                }

                CurrentEntry?.Instance.OnNavigatingFrom(navigatingFromArgs);

                if (navigatingFromArgs.Cancel)
                {
                    // Page canceled
                    OnNavigationStopped(entry, mode);
                    return(false);
                }

                // Navigate
                var previousEntry = CurrentEntry;
                CurrentEntry = entry;

                if (mode == NavigationMode.New)
                {
                    // Doing this first allows CurrentEntry to reuse existing page if pooling is enabled
                    ReleasePages(ForwardStack);
                }

                if (CurrentEntry.Instance == null)
                {
                    var page = CreatePageInstanceCached(entry.SourcePageType);
                    if (page == null)
                    {
                        return(false);
                    }

                    page.Frame            = this;
                    CurrentEntry.Instance = page;
                }

                Content = CurrentEntry.Instance;

                if (IsNavigationStackEnabled)
                {
                    switch (mode)
                    {
                    case NavigationMode.New:
                        ForwardStack.Clear();
                        if (previousEntry != null)
                        {
                            BackStack.Add(previousEntry);
                        }
                        break;

                    case NavigationMode.Back:
                        ForwardStack.Add(previousEntry);
                        BackStack.Remove(CurrentEntry);
                        break;

                    case NavigationMode.Forward:
                        BackStack.Add(previousEntry);
                        ForwardStack.Remove(CurrentEntry);
                        break;

                    case NavigationMode.Refresh:
                        break;
                    }
                }

                // Navigated
                var navigationEvent = new NavigationEventArgs(
                    CurrentEntry.Instance,
                    mode,
                    entry.NavigationTransitionInfo,
                    entry.Parameter,
                    entry.SourcePageType,
                    null
                    );

                previousEntry?.Instance.OnNavigatedFrom(navigationEvent);
                CurrentEntry.Instance.OnNavigatedTo(navigationEvent);
                Navigated?.Invoke(this, navigationEvent);

                VisualTreeHelper.CloseAllPopups();

                return(true);
            }
            catch (Exception exception)
            {
                NavigationFailed?.Invoke(this, new NavigationFailedEventArgs(entry.SourcePageType, exception));

                if (NavigationFailed == null)
                {
                    Application.Current.RaiseRecoverableUnhandledException(new InvalidOperationException("Navigation failed", exception));
                }

                return(false);
            }
        }
Exemple #30
0
 protected void FireNavigatedEvent()
 {
     Navigated?.Invoke(this, new EventArgs());
 }