Ejemplo n.º 1
0
        /// <summary>
        /// 네비게이션
        /// </summary>
        /// <param name="navigation"></param>
        /// <param name="navigationParameter"></param>
        /// <returns></returns>
        public override bool Navigation(string navigation, object navigationParameter)
        {
            var returnValue = false;

            if (_frame == null)
            {
                return(false);
            }

            if (navigation == "GoBack")
            {
                if (_frame.CanGoBack)
                {
                    _frame.GoBack();
                }
                return(true);
            }
            var t = Windows.UI.Xaml.Application.Current.GetType().GetTypeInfo().Assembly.GetType(navigation);

            if (t != null && t != typeof(Uri))
            {
                returnValue = _frame.Navigate(t, navigationParameter);
            }
            return(returnValue);
        }
Ejemplo n.º 2
0
        public bool LogIn(Windows.UI.Xaml.Controls.WebView webView, Windows.UI.Xaml.Controls.Frame parentFrame)
        {
            var uri = driveLink.GetStartUri();

            webView.Navigate(uri);

            webView.NavigationCompleted += (s, e) =>
            {
                if (driveLink.CheckRedirectUrl(e.Uri.AbsoluteUri))
                {
                    driveLink.ContinueGetTokens(e.Uri);
                    var dialog = new Windows.UI.Popups.MessageDialog("You are authenticated!", "Success!");
                    dialog.ShowAsync();
                    parentFrame.GoBack();
                }
            };

            webView.NavigationFailed += (s, e) =>
            {
                driveLink.ContinueGetTokens(null);
                var dialog = new Windows.UI.Popups.MessageDialog("There problems authenticating you. Please try again :(", "Fail!");
                dialog.ShowAsync();
                parentFrame.GoBack();
            };
            return(true);
        }
Ejemplo n.º 3
0
        async void _navigationBackward()
        {
            var currentPage = _rootElement.Content as XPage;

            if (currentPage != null && currentPage.DataContext != null && currentPage.DataContext == _rootFrame.CurrentContentObject)
            {
                //This page is already correct (probably an out of XCore back)
                return;
            }

            do
            {
                if (!_rootElement.CanGoBack)
                {
                    break;
                }

                var p            = _rootElement.BackStack.LastOrDefault();
                var vm           = p.Parameter;
                var notCorrectVm = _rootFrame.CurrentContentObject != vm;

                if (!notCorrectVm)
                {
                    break;
                }
            } while (true);

            _rootElement.GoBack();
            _updateSystemButton();
        }
Ejemplo n.º 4
0
        private void OnBackRequested(object sender, BackRequestedEventArgs e)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame.CanGoBack)
            {
                e.Handled = true;
                rootFrame.GoBack();
            }
        }
Ejemplo n.º 5
0
        public void GoBack( )
        {
            m_frame.GoBack( );

            var content = m_frame.Content as IView;

            if (content != null)
            {
                CurrentViewModel = content.ViewModelObject;
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history.
 /// </summary>
 public void GoBack()
 {
     _frame.GoBack();
 }