예제 #1
0
        /// <summary>
        /// Fired when the user presses the back button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PanelManager_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e)
        {
            // If if anyone else wants to handle this
            OnGoBackArgs args = new OnGoBackArgs();

            m_onGoBack.Raise(this, args);

            // If someone else already reacted don't do anything.
            if (args.IsHandled)
            {
                return;
            }

            // If we can go back mark it handled
            e.Handled = CanGoBack();

            if (e.Handled)
            {
                // Call go back but this might not work, we can't go back while something else is navigating.
                // If we can't go back right now just silently ignore the request.
                GoBack();
            }
            else
            {
                // If we can't go back anymore for the last back show the menu.
                // After that let the user leave.
                if (!m_finalNavigateHasShownMenu)
                {
                    m_finalNavigateHasShownMenu = true;
                    e.Handled = true;
                    ToggleMenu(true);
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Fired when the user tapped go back.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PanelManager_OnGoBack(object sender, OnGoBackArgs e)
 {
     // If the presenter is open close it and mark the back handled.
     if (ui_globalContentPresenter.State != GlobalContentStates.Idle)
     {
         ui_globalContentPresenter.Close();
         e.IsHandled = true;
     }
 }