Exemplo n.º 1
0
            /**
             * @author Filipas Ciprian
             * @brief Function responsible with the closing action for the picker page.
             */
            private void ClosePickerPage()
            {
                // Unhook from events
                if (null != mFrame)
                {
                    mFrame.Navigated         -= OnFrameNavigated;
                    mFrame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
                    mFrame.NavigationFailed  -= OnFrameNavigationStoppedOrFailed;

                    // Restore host page transitions for the completed "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = mFrameContentWhenOpened as UIElement;
                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, mSavedNavigationInTransition);
                        mSavedNavigationInTransition = null;
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, mSavedNavigationOutTransition);
                        mSavedNavigationOutTransition = null;
                    }

                    mFrame = null;
                    mFrameContentWhenOpened = null;
                }
                // Commit the value if available
                if (null != mNumberPickerPage)
                {
                    if (mNumberPickerPage.Value.HasValue)
                    {
                        Value = mNumberPickerPage.Value.Value;
                    }
                    mNumberPickerPage = null;
                }
            }
Exemplo n.º 2
0
 /**
  * @authro Ciprian Filipas
  * @brief handler for the Frame.Navigated event.
  */
 private void OnFrameNavigated(object sender, NavigationEventArgs e)
 {
     if (e.Content == mFrameContentWhenOpened)
     {
         ClosePickerPage();
     }
     else if (null == mNumberPickerPage)
     {
         mNumberPickerPage = e.Content as mosyncRuntime.Views.CustomNumberPickerPage;
         if (null != mNumberPickerPage)
         {
             mNumberPickerPage.Value = Value;
         }
     }
 }