예제 #1
0
파일: Picker.cs 프로젝트: shawnoster/kudu
        private void ClosePickerPage()
        {
            if (null == _frame)
            {
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;

                // Unhook from events
                if (null != _frame)
                {
                    _frame.Navigated         -= OnFrameNavigated;
                    _frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
                    _frame.NavigationFailed  -= OnFrameNavigationStoppedOrFailed;

                    // Restore host page transitions for the completed "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;

                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, _savedNavigationInTransition);
                        _savedNavigationInTransition = null;
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, _savedNavigationOutTransition);
                        _savedNavigationOutTransition = null;
                    }

                    _frame = null;
                    _frameContentWhenOpened = null;
                }
            }
        }
예제 #2
0
        public PivotPage9()
        {
            InitializeComponent();
            #region EFFECTS SETTINGS
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion

            listPicker.ItemsSource = new List <string>()
            {
                "Kedi", "Köpek", "Kuş", "Balık", "Su Kaplumbağası"
            };
        }
        public DetailsElementPage()
        {
            InitializeComponent();
            #region Animation
            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion

            this.gcw = new GeoCoordinateWatcher();
            this.gcw.PositionChanged += new EventHandler <GeoPositionChangedEventArgs <GeoCoordinate> >(gcw_PositionChanged);
            this.gcw.Start();
        }
예제 #4
0
        public PivotPage8()
        {
            InitializeComponent();
            #region EFFECTS SETTINGS
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion


            listPicker.ItemsSource = new List <string>()
            {
                "Dans", "Resim", "Oyun", "Kitap", "Film"
            };
        }
예제 #5
0
        public AnimatedRotatePhoneApplicationPage()
            : base()
        {
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.BackwardIn
            };
            navigateInTransition.Forward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.ForwardIn
            };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.BackwardOut
            };
            navigateOutTransition.Forward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.ForwardOut
            };
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            OrientationChanged += new EventHandler <OrientationChangedEventArgs>(Page_OrientationChanged);
            lastOrientation     = this.Orientation;

            Loaded += new RoutedEventHandler(Page_Loaded);

            // Fix bug with capturing screen in white theme
            Background = (Brush)Application.Current.Resources["PhoneBackgroundBrush"];
        }
        public void OpenPickerPage()
        {
            if (null == PickerPageUri)
            {
                throw new ArgumentException("PickerPageUri property must not be null.");
            }

            if (null == _frame)
            {
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;
                if (null != _frame)
                {
                    _frameContentWhenOpened = _frame.Content;

                    // Save and clear host page transitions for the upcoming "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        _savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
                        _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
                    }

                    _frame.Navigated += OnFrameNavigated;
                    _frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
                    _frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;

                    _frame.Navigate(PickerPageUri);

                }
            }
        }
        /// <summary>
        /// Handles the BackKeyPress to stop the animation and go back.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnBackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // No need to handle backkeypress if exit transition is complete.
            if (_performingExitTransition)
            {
                var oldElement = Content as UIElement;
                if (oldElement == null)
                {
                    return;
                }

                TransitionElement       oldTransitionElement    = null;
                NavigationOutTransition navigationOutTransition = null;
                ITransition             oldTransition           = null;

                navigationOutTransition = TransitionService.GetNavigationOutTransition(oldElement);

                if (navigationOutTransition != null)
                {
                    oldTransitionElement = _isForwardNavigation ? navigationOutTransition.Forward : navigationOutTransition.Backward;
                }
                if (oldTransitionElement != null)
                {
                    oldTransition = oldTransitionElement.GetTransition(oldElement);
                }
                if (oldTransition != null)
                {
                    CompleteTransition(_storedNavigationOutTransition, /*_oldContentPresenter*/ null, _storedOldTransition);
                    TransitionNewContent(oldTransition, null);
                }
            }
        }
예제 #8
0
        private void ClosePickerPage()
        {
            // Unhook from events
            if (null != _frame)
            {
                _frame.Navigated         -= OnFrameNavigated;
                _frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
                _frame.NavigationFailed  -= OnFrameNavigationStoppedOrFailed;

                // Restore host page transitions for the completed "popup" navigation
                var frameContentWhenOpenedAsUiElement = _frameContentWhenOpened as UIElement;
                if (null != frameContentWhenOpenedAsUiElement)
                {
                    TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUiElement, _savedNavigationInTransition);
                    _savedNavigationInTransition = null;

                    TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUiElement, _savedNavigationOutTransition);
                    _savedNavigationOutTransition = null;
                }

                _frame = null;
                _frameContentWhenOpened = null;
            }

            // Commit the value if available
            if (null != _valuePickerPage)
            {
                if (_valuePickerPage.Value.HasValue)
                {
                    Value = _valuePickerPage.Value.Value;
                }
                _valuePickerPage = null;
            }
        }
예제 #9
0
        public SettingsPage()
        {
            InitializeComponent();

            if (Application.Current.RootVisual is Microsoft.Phone.Controls.TransitionFrame)
            {
                NavigationInTransition transitionIn = new NavigationInTransition()
                {
                    Backward = new TurnstileFeatherTransition {
                        Mode = TurnstileFeatherTransitionMode.BackwardIn
                    }, Forward = new SwivelTransition {
                        Mode = SwivelTransitionMode.ForwardIn
                    }
                };
                NavigationOutTransition transitionOut = new NavigationOutTransition()
                {
                    Backward = new SwivelTransition {
                        Mode = SwivelTransitionMode.BackwardOut
                    }, Forward = new SwivelTransition {
                        Mode = SwivelTransitionMode.ForwardOut
                    }
                };

                this.SetValue(Microsoft.Phone.Controls.TransitionService.NavigationInTransitionProperty, transitionIn);
                this.SetValue(Microsoft.Phone.Controls.TransitionService.NavigationOutTransitionProperty, transitionOut);
            }

            Loaded += SettingsPage_Loaded;
        }
예제 #10
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            //Thread.Sleep(2000);
            // anda bisa mengganti SlideTransitionMode sesuai dengan keinginan
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            connectionManager = new ConnectionManager();
            connectionManager.MessageReceived += connectionManager_MessageReceived;
            stateManager = new StateManager();
            // Get current location.
            GetLocation();
        }
예제 #11
0
        public void Show()
        {
            if (_frame == null)
            {
                // Hook up to necessary events and navigate
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;
                _frameContentWhenOpened = _frame.Content;

                var frameContentWhenOpenedAsUiElement = _frameContentWhenOpened as UIElement;
                if (null != frameContentWhenOpenedAsUiElement)
                {
                    _savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUiElement);
                    TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUiElement, null);
                    _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUiElement);
                    TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUiElement, null);
                }

                _frame.Navigated += HandleFrameNavigated;

                if (_frame.GetType() == typeof(PhoneApplicationFrame))
                {
                    _frame.NavigationStopped += HandleFrameNavigationStoppedOrFailed;
                }

                _frame.NavigationFailed += HandleFrameNavigationStoppedOrFailed;

                _frame.Navigate(_pageUri);
            }
        }
예제 #12
0
        /// <summary>
        /// Initializes a new instance of the GooglePlus.Library.Controls.AppPage class.
        /// </summary>
        public AppPage()
            : base()
        {
            SupportedOrientations = SupportedPageOrientation.Portrait;
            Orientation           = PageOrientation.Portrait;

            SetValue(TiltEffect.IsTiltEnabledProperty, true);

            SetValue(SystemTray.ProgressIndicatorProperty, ProgressIndicator);
            SetValue(SystemTray.IsVisibleProperty, true);

            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new TurnstileFeatherTransition {
                Mode = TurnstileFeatherTransitionMode.BackwardIn
            };
            navigateInTransition.Forward = new TurnstileFeatherTransition {
                Mode = TurnstileFeatherTransitionMode.ForwardIn
            };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new TurnstileFeatherTransition {
                Mode = TurnstileFeatherTransitionMode.BackwardOut
            };
            navigateOutTransition.Forward = new TurnstileFeatherTransition {
                Mode = TurnstileFeatherTransitionMode.ForwardOut
            };
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            lastOrientation     = Orientation;
            OrientationChanged += new EventHandler <OrientationChangedEventArgs>(Page_OrientationChanged);
        }
예제 #13
0
        private void ClosePickerPage()
        {
            if (this._frame != null)
            {
                // ISSUE: method pointer
                ((Frame)this._frame).Navigated -= (new NavigatedEventHandler(this.OnFrameNavigated));
                // ISSUE: method pointer
                ((Frame)this._frame).NavigationStopped -= (new NavigationStoppedEventHandler(this.OnFrameNavigationStoppedOrFailed));
                // ISSUE: method pointer
                ((Frame)this._frame).NavigationFailed -= (new NavigationFailedEventHandler(this.OnFrameNavigationStoppedOrFailed));
                UIElement contentWhenOpened = this._frameContentWhenOpened as UIElement;
                if (contentWhenOpened != null)
                {
                    TransitionService.SetNavigationInTransition(contentWhenOpened, this._savedNavigationInTransition);
                    this._savedNavigationInTransition = null;
                    TransitionService.SetNavigationOutTransition(contentWhenOpened, this._savedNavigationOutTransition);
                    this._savedNavigationOutTransition = null;
                }
                this._frame = null;
                this._frameContentWhenOpened = null;
            }
            if (this._dateTimePickerPage == null)
            {
                return;
            }
            DateTime?nullable = this._dateTimePickerPage.Value;

            if (nullable.HasValue)
            {
                nullable   = this._dateTimePickerPage.Value;
                this.Value = new DateTime?(nullable.Value);
            }
            this._dateTimePickerPage = null;
        }
예제 #14
0
        public PivotPage5()
        {
            InitializeComponent();
            #region EFFECTS SETTINGS
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion

            listPicker.ItemsSource = new List <string>()
            {
                "Doğum Günü", "Yıl Dönümü", "Yılbaşı"
            };
        }
        /// <summary>
        /// Stops the last navigation transition if it's active and a new navigation occurs.
        /// </summary>
        private void EnsureLastTransitionIsComplete()
        {
            _readyToTransitionToNewContent = false;
            _contentReady = false;

            if (_performingExitTransition)
            {
                Debug.Assert(_storedOldTransition != null && _storedNavigationOutTransition != null);

                // If the app calls GoBack on NavigatedTo, we want the old content to be null
                // because you can't have the same content in two spots on the visual tree.
                _oldContentPresenter.Content = null;

                _storedOldTransition.Stop();

                _storedNavigationOutTransition = null;
                _storedOldTransition           = null;

                if (_storedNewTransition != null)
                {
                    _storedNewTransition.Stop();

                    _storedNewTransition          = null;
                    _storedNavigationInTransition = null;
                }

                _performingExitTransition = false;
            }
        }
예제 #16
0
        public PivotPage4()
        {
            InitializeComponent();

            #region EFFECTS SETTINGS
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion
        }
예제 #17
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;

            #region EFFECTS SETTINGS
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion
        }
예제 #18
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            wupdater     = new WebUpdater(this);
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

            Pontinhos                 = new ProgressIndicator();
            Pontinhos.Text            = "Carregando...";
            Pontinhos.IsIndeterminate = true;
            SystemTray.SetProgressIndicator(this, Pontinhos);

            FirstLoad = true;

            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.BackwardIn
            };
            navigateInTransition.Forward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.ForwardIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.BackwardOut
            };
            navigateOutTransition.Forward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.ForwardOut
            };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
        }
예제 #19
0
            /**
             * @author Ciprian Filipas
             * @brief Function responsible with the open action for the picker page.
             */
            private void OpenPickerPage()
            {
                if (null == mFrame)
                {
                    // Hook up to necessary events and navigate
                    mFrame = Application.Current.RootVisual as PhoneApplicationFrame;
                    if (null != mFrame)
                    {
                        mFrameContentWhenOpened = mFrame.Content;

                        // Save and clear host page transitions for the upcoming "popup" navigation
                        UIElement frameContentWhenOpenedAsUIElement = mFrameContentWhenOpened as UIElement;
                        if (null != frameContentWhenOpenedAsUIElement)
                        {
                            mSavedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
                            TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
                            mSavedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
                            TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
                        }

                        mFrame.Navigated         += OnFrameNavigated;
                        mFrame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
                        mFrame.NavigationFailed  += OnFrameNavigationStoppedOrFailed;

                        NumberPickerPageCustomUriString customString = new NumberPickerPageCustomUriString();
                        customString.Max = Max;
                        customString.Min = Min;

                        mFrame.Navigate(new Uri(customString.UriString, UriKind.RelativeOrAbsolute));
                    }
                }
            }
예제 #20
0
파일: Picker.cs 프로젝트: shawnoster/kudu
        private void OpenPickerPage()
        {
            if (null == PickerPageUri)
            {
                throw new ArgumentException("PickerPageUri property must not be null.");
            }

            if (null == _frame)
            {
                // Hook up to necessary events and navigate
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;
                if (null != _frame)
                {
                    _frameContentWhenOpened = _frame.Content;

                    // Save and clear host page transitions for the upcoming "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        _savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
                        _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
                    }

                    _frame.Navigated         += OnFrameNavigated;
                    _frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
                    _frame.NavigationFailed  += OnFrameNavigationStoppedOrFailed;

                    _frame.Navigate(PickerPageUri);
                }
            }
        }
예제 #21
0
        public Home()
        {
            InitializeComponent();

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
            navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeOut };
            navigateOutTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            ifc = FacadeController.getInstance();
            User loggedUser = ifc.getCurrentUser();

            profileNameTxtBlock.Text = loggedUser.FirstName + " " + loggedUser.LastName;
            profileCountryTxtBlock.Text = loggedUser.Country;
            profileEmailTextBlock.Text = loggedUser.Email;
            Uri uri = new Uri(loggedUser.ImageUrl, UriKind.Absolute);
            profileImage.Source = new BitmapImage(uri);

            this.initChallengesListBox();
            this.InitRankingListBox();
        }
        /// <summary>
        /// Handles the completion of the exit transition, automatically
        /// continuing to bring in the new element's transition as well if it is
        /// ready.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnExitTransitionCompleted(object sender, EventArgs e)
        {
            _readyToTransitionToNewContent = true;
            _performingExitTransition      = false;

            if (_navigationStopped)
            {
                // Restore the old content presenter's interactivity if the navigation is cancelled.
                CompleteTransition(_storedNavigationOutTransition, _oldContentPresenter, _storedOldTransition);
                _navigationStopped = false;
            }
            else
            {
                CompleteTransition(_storedNavigationOutTransition, /*_oldContentPresenter*/ null, _storedOldTransition);
            }

            _storedNavigationOutTransition = null;
            _storedOldTransition           = null;

            if (_contentReady)
            {
                ITransition            newTransition          = _storedNewTransition;
                NavigationInTransition navigationInTransition = _storedNavigationInTransition;

                _storedNewTransition          = null;
                _storedNavigationInTransition = null;

                TransitionNewContent(newTransition, navigationInTransition);
            }
        }
예제 #23
0
        private void OpenPickerPage()
        {
            if ((Uri)null == this.PickerPageUri)
            {
                throw new ArgumentException("PickerPageUri property must not be null.");
            }
            if (this._frame != null)
            {
                return;
            }
            this._frame = Application.Current.RootVisual as PhoneApplicationFrame;
            if (this._frame == null)
            {
                return;
            }
            this._frameContentWhenOpened = this._frame.Content;
            UIElement element = this._frameContentWhenOpened as UIElement;

            if (element != null)
            {
                this._savedNavigationInTransition = TransitionService.GetNavigationInTransition(element);
                TransitionService.SetNavigationInTransition(element, (NavigationInTransition)null);
                this._savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(element);
                TransitionService.SetNavigationOutTransition(element, (NavigationOutTransition)null);
            }
            this._frame.Navigated         += new NavigatedEventHandler(this.OnFrameNavigated);
            this._frame.NavigationStopped += new NavigationStoppedEventHandler(this.OnFrameNavigationStoppedOrFailed);
            this._frame.NavigationFailed  += new NavigationFailedEventHandler(this.OnFrameNavigationStoppedOrFailed);
            this._frame.Navigate(this.PickerPageUri);
        }
예제 #24
0
        private void OpenPickerPage()
        {
            if (null == this.PickerPageUri)
            {
                throw new ArgumentException("PickerPageUri property must not be null.");
            }
            if (this._frame != null)
            {
                return;
            }
            this._frame = Application.Current.RootVisual as PhoneApplicationFrame;
            if (this._frame == null)
            {
                return;
            }
            this._frameContentWhenOpened = ((ContentControl)this._frame).Content;
            UIElement contentWhenOpened = this._frameContentWhenOpened as UIElement;

            if (contentWhenOpened != null)
            {
                this._savedNavigationInTransition = TransitionService.GetNavigationInTransition(contentWhenOpened);
                TransitionService.SetNavigationInTransition(contentWhenOpened, null);
                this._savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(contentWhenOpened);
                TransitionService.SetNavigationOutTransition(contentWhenOpened, null);
            }
            // ISSUE: method pointer
            ((Frame)this._frame).Navigated += (new NavigatedEventHandler(this.OnFrameNavigated));
            // ISSUE: method pointer
            ((Frame)this._frame).NavigationStopped += (new NavigationStoppedEventHandler(this.OnFrameNavigationStoppedOrFailed));
            // ISSUE: method pointer
            ((Frame)this._frame).NavigationFailed += (new NavigationFailedEventHandler(this.OnFrameNavigationStoppedOrFailed));
            ((Frame)this._frame).Navigate(this.PickerPageUri);
        }
        /// <summary>
        /// Opens the page to select the date or time value
        /// </summary>
        private void OpenPickerPage(DateTimePickerType type)
        {
            string pickerPageName = type == DateTimePickerType.Date ? "DatePickerPage.xaml" : "TimePickerPage.xaml";

            Uri pickerPageUri = new System.Uri("/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/" +
                                               pickerPageName + "?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative);

            if (null == _frame)
            {
                // Hook up to necessary events and navigate
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;
                if (null != _frame)
                {
                    _frameContentWhenOpened = _frame.Content;

                    // Save and clear host page transitions for the upcoming "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        _savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
                        _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
                    }

                    _frame.Navigated         += OnFrameNavigated;
                    _frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
                    _frame.NavigationFailed  += OnFrameNavigationStoppedOrFailed;

                    _frame.Navigate(pickerPageUri);
                }
            }
        }
예제 #26
0
        public PivotPage6()
        {
            InitializeComponent();
            #region EFFECTS SETTINGS
            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeIn
            };
            navigateInTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new SlideTransition {
                Mode = SlideTransitionMode.SlideDownFadeOut
            };
            navigateOutTransition.Forward = new SlideTransition {
                Mode = SlideTransitionMode.SlideUpFadeOut
            };

            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
            #endregion

            listPicker.ItemsSource = new List <string>()
            {
                "Beşiktaş", "Galatasaray", "Fenerbahçe", "Trabzonspor"
            };
        }
예제 #27
0
        public PageBase()
        {
            var navInTransition = new NavigationInTransition
            {
                Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn },
                Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn }
            };

            var navOutTransition = new NavigationOutTransition
            {
                Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut },
                Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut }
            };

            TransitionService.SetNavigationInTransition(this, navInTransition);
            TransitionService.SetNavigationOutTransition(this, navOutTransition);

            SetValue(TiltEffect.IsTiltEnabledProperty, true);

            Language = System.Windows.Markup.XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);

            Progress = new ProgressIndicator
            {
                IsIndeterminate = false,
                IsVisible = true
            };

            SystemTray.SetProgressIndicator(this, Progress);

            if (!DesignerProperties.IsInDesignTool)
            {
                Service = App.Service;
            }
        }
예제 #28
0
        private void ClosePickerPage()
        {
            if (this._frame != null)
            {
                this._frame.Navigated         -= new NavigatedEventHandler(this.OnFrameNavigated);
                this._frame.NavigationStopped -= new NavigationStoppedEventHandler(this.OnFrameNavigationStoppedOrFailed);
                this._frame.NavigationFailed  -= new NavigationFailedEventHandler(this.OnFrameNavigationStoppedOrFailed);
                UIElement element = this._frameContentWhenOpened as UIElement;
                if (element != null)
                {
                    TransitionService.SetNavigationInTransition(element, this._savedNavigationInTransition);
                    this._savedNavigationInTransition = (NavigationInTransition)null;
                    TransitionService.SetNavigationOutTransition(element, this._savedNavigationOutTransition);
                    this._savedNavigationOutTransition = (NavigationOutTransition)null;
                }
                this._frame = (PhoneApplicationFrame)null;
                this._frameContentWhenOpened = null;
            }
            if (this._dateTimePickerPage == null)
            {
                return;
            }
            DateTime?nullable = this._dateTimePickerPage.Value;

            if (nullable.HasValue)
            {
                nullable   = this._dateTimePickerPage.Value;
                this.Value = new DateTime?(nullable.Value);
            }
            this._dateTimePickerPage = (IDateTimePickerPage)null;
        }
예제 #29
0
        public void SwitchNavigationEffects()
        {
            NavigationInTransition navigationInTransition = new NavigationInTransition();

            navigationInTransition.Backward = (TransitionElement) new TurnstileTransition()
            {
                Mode = TurnstileTransitionMode.ForwardIn
            };
            navigationInTransition.Forward = (TransitionElement) new TurnstileTransition()
            {
                Mode = TurnstileTransitionMode.BackwardIn
            };
            TransitionService.SetNavigationInTransition((UIElement)this, navigationInTransition);
            NavigationOutTransition navigationOutTransition = new NavigationOutTransition();

            navigationOutTransition.Backward = (TransitionElement) new TurnstileTransition()
            {
                Mode = TurnstileTransitionMode.ForwardOut
            };
            navigationOutTransition.Forward = (TransitionElement) new TurnstileTransition()
            {
                Mode = TurnstileTransitionMode.BackwardOut
            };
            TransitionService.SetNavigationOutTransition((UIElement)this, navigationOutTransition);
        }
예제 #30
0
        public Sobre()
        {
            InitializeComponent();

            Versao.Text = "Versão 1.0.3.0";

            NavigationInTransition navigateInTransition = new NavigationInTransition();

            navigateInTransition.Backward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.BackwardIn
            };
            navigateInTransition.Forward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.ForwardIn
            };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();

            navigateOutTransition.Backward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.BackwardOut
            };
            navigateOutTransition.Forward = new TurnstileTransition {
                Mode = TurnstileTransitionMode.ForwardOut
            };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
        }
        /// <summary>
        /// Handles the Navigating event of the frame, the immediate way to
        /// begin a transition out before the new page has loaded or had its
        /// layout pass.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            // If the current application is not the origin
            // and destination of the navigation, ignore it.
            // e.g. do not play a transition when the
            // application gets deactivated because the shell
            // will animate the frame out automatically.
            if (!e.IsNavigationInitiator)
            {
                return;
            }

            _isForwardNavigation = e.NavigationMode != NavigationMode.Back;

            var oldElement = Content as UIElement;

            if (oldElement == null)
            {
                return;
            }

            EnsureLastTransitionIsComplete();

            FlipPresenters();

            TransitionElement oldTransitionElement = null;
            ITransition       oldTransition        = null;

            NavigationOutTransition navigationOutTransition = TransitionService.GetNavigationOutTransition(oldElement);

            if (navigationOutTransition != null)
            {
                oldTransitionElement = _isForwardNavigation ? navigationOutTransition.Forward : navigationOutTransition.Backward;
            }

            if (oldTransitionElement != null)
            {
                oldTransition = oldTransitionElement.GetTransition(oldElement);
            }

            if (oldTransition != null)
            {
                EnsureStoppedTransition(oldTransition);

                _storedNavigationOutTransition = navigationOutTransition;
                _storedOldTransition           = oldTransition;
                oldTransition.Completed       += OnExitTransitionCompleted;

                _performingExitTransition = true;

                PerformTransition(navigationOutTransition, _oldContentPresenter, oldTransition);

                PrepareContentPresenterForCompositor(_oldContentPresenter);
            }
            else
            {
                _readyToTransitionToNewContent = true;
            }
        }
예제 #32
0
 /// <summary>
 /// Sets a
 /// <see cref="T:ModernWpf.Controls.NavigationTransition"/>s
 /// to
 /// <see cref="M:ModernWpf.Controls.TransitionService.NavigationOutTransitionProperty"/>
 /// for a
 /// <see cref="T:System.Windows.UIElement"/>.
 /// </summary>
 /// <param name="element">The <see cref="T:System.Windows.UIElement"/>.</param>
 /// <param name="value">The <see cref="T:ModernWpf.Controls.NavigationTransition"/>.</param>
 /// <returns>The </returns>
 public static void SetNavigationOutTransition(UIElement element, NavigationOutTransition value)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(NavigationOutTransitionProperty, value);
 }
예제 #33
0
        private static void SetOutTransition(UIElement element)
        {
            var outTransition = new NavigationOutTransition();

            outTransition.Backward = Create(SlideTransitionMode.SlideRightFadeOut);
            outTransition.Forward  = Create(SlideTransitionMode.SlideLeftFadeOut);
            TransitionService.SetNavigationOutTransition(element, outTransition);
        }
예제 #34
0
        public history_page()
        {
            InitializeComponent();
            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideDownFadeIn };
            navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideUpFadeIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideDownFadeOut };
            navigateOutTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideUpFadeOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

        }
예제 #35
0
        public Challenge10()
        {
            InitializeComponent();

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
            navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeOut };
            navigateOutTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
        }
예제 #36
0
파일: 2UG.xaml.cs 프로젝트: DISD/2UG
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            //Creates the animation when another page is loaded
            NavigationInTransition navigationInTransition = new NavigationInTransition();
            navigationInTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn };
            navigationInTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn};

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut };
            navigateOutTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut };
            TransitionService.SetNavigationInTransition(this, navigationInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            
        }
예제 #37
0
        public Sobre()
        {
            InitializeComponent();

            Versao.Text = "Versão 1.0.3.0";

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn };
            navigateInTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut };
            navigateOutTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
        }
예제 #38
0
        private bool useEmulation = (Microsoft.Devices.Environment.DeviceType == DeviceType.Emulator); // Indica si estamos corriendo la aplicacion en el emulador o en el dispositivo.

        #endregion Fields

        #region Constructors

        public Challenge1()
        {
            // INICIALIZAMOS LOS COMPONENTES GRAFICOS.
            InitializeComponent();

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
            navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeOut };
            navigateOutTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            this.inicializar();
        }
예제 #39
0
        protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);

            if (e.Uri.OriginalString == "/Config.xaml?Initial=1")
            {
                navigationOut = TransitionService.GetNavigationOutTransition(this);

                // Prevent page transistion, since that's ugly ;)
                TransitionService.SetNavigationOutTransition(this, new NavigationOutTransition());

                // Also, prevent the backstack from returning to Config
                NavigationService.RemoveBackEntry();
            }
            else
                TransitionService.SetNavigationOutTransition(this, navigationOut);
        }
        private void ClosePickerPage()
        {
            if (_frame != null)
            {
                _frame.Navigated -= OnDateFrameNavigated;
                _frame.Navigated -= OnTimeFrameNavigated;
                _frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
                _frame.NavigationFailed -= OnFrameNavigationStoppedOrFailed;

                var uiElement = _frameContentWhenOpened as UIElement;
                if (uiElement != null)
                {
                    TransitionService.SetNavigationInTransition(uiElement, _savedNavigationInTransition);
                    _savedNavigationInTransition = null;
                    TransitionService.SetNavigationOutTransition(uiElement, _savedNavigationOutTransition);
                    _savedNavigationOutTransition = null;
                }

                _frame = null;
                _frameContentWhenOpened = null;
            }

            var taskResult = new DateTimeResult(TaskResult.Cancel);

            if (_dateTimePickerPage != null)
            {
                if (_dateTimePickerPage.Value.HasValue)
                {
                    Value = _dateTimePickerPage.Value.Value;
                    taskResult = new DateTimeResult(TaskResult.OK) { Value = Value.Value };
                }
            }
            if (_timeSpanPickerPage != null)
            {
                if (_timeSpanPickerPage.Value.HasValue)
                {
                    Value = new DateTime(1970, 1, 1, 0, 0, 0, 0) + _timeSpanPickerPage.Value.Value;
                    taskResult = new DateTimeResult(TaskResult.OK) { Value = Value.Value };
                }
            }

            _dateTimePickerPage = null;
            _timeSpanPickerPage = null;

            Completed(this, taskResult);
        }
예제 #41
0
파일: BasePage.cs 프로젝트: vfede/Uni-WiFi
        public BasePage()
        {
            //Activate Page Transition effects on every page
            NavigationInTransition navigationInTransition = new NavigationInTransition()
            {
                Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn },
                Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn }
            };

            NavigationOutTransition navigationOutTransition = new NavigationOutTransition()
            {
                Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut },
                Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut }
            };

            TransitionService.SetNavigationInTransition(this, navigationInTransition);
            TransitionService.SetNavigationOutTransition(this, navigationOutTransition);
        }
        private void OpenPickerPage(DateTimePickerType type)
        {
            var page = type == DateTimePickerType.Date
                           ? "/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/DatePickerPage.xaml?dummy="
                           : "/Coding4Fun.Toolkit.Controls;component/ValuePicker/TimeSpanPicker/TimespanPickerPage.xaml?dummy=";

            page += Guid.NewGuid();

            var pickerPageUri = new Uri(page, UriKind.Relative);

            if (_frame != null) return;
            _frame = Application.Current.RootVisual as PhoneApplicationFrame;

            if (_frame == null) return;

            _frameContentWhenOpened = _frame.Content;

            var uiElement = _frameContentWhenOpened as UIElement;
            if (null != uiElement)
            {
                _savedNavigationInTransition = TransitionService.GetNavigationInTransition(uiElement);
                TransitionService.SetNavigationInTransition(uiElement, null);
                _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(uiElement);
                TransitionService.SetNavigationOutTransition(uiElement, null);
            }

            if (type == DateTimePickerType.Date)
            {
                _frame.Navigated += OnDateFrameNavigated;
            }
            else
            {
                _frame.Navigated += OnTimeFrameNavigated;
            }
            _frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
            _frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;

            _frame.Navigate(pickerPageUri);
        }
        public ChallengeDetail()
        {
            InitializeComponent();

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
            navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeOut };
            navigateOutTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            IFacadeController ifc = FacadeController.getInstance();
            challenge = ifc.getCurrentChallenge();

            this.PageTitle.Text = challenge.Name;
            imageRec.Fill = GetColorFromHexa(challenge.ColorHex);
            Uri uri = new Uri("/BeatIt!;component/Images/icon_challenge_" + challenge.ChallengeId + ".png", UriKind.Relative);
            iconImage.Source = new BitmapImage(uri);
        }
예제 #44
0
        private UsainBolt desafio; // Instancia del desafio que se esta corriendo.

        #endregion Fields

        #region Constructors

        public Challenge4()
        {
            InitializeComponent();

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeIn };
            navigateInTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new SlideTransition { Mode = SlideTransitionMode.SlideRightFadeOut };
            navigateOutTransition.Forward = new SlideTransition { Mode = SlideTransitionMode.SlideLeftFadeOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);

            IChallengeController ich = ChallengeController.getInstance();
            this.desafio = (UsainBolt)ich.getChallenge(AppCode.Enums.ChallengeType.CHALLENGE_TYPE.USAIN_BOLT);

            // INICIALIZAMOS LAS ETIQUETAS DEL DETALLE DEL DESAFIO
            this.ShowST.Text = this.desafio.getDTChallenge().getStartTime().ToString(); // Ojo ver el tema de la fecha y hora (Cuando estamos en el limite de una ronda y la otra).
            this.ShowToBeat.Text = this.desafio.getPuntajeObtenido() + " pts";
            DateTime roundDate = new DateTime(2014, 9, 28, 22, 0, 0);
            this.ShowDuration.Text = getDurationString(roundDate);
        }
예제 #45
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            wupdater = new WebUpdater(this);
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

            Pontinhos = new ProgressIndicator();
            Pontinhos.Text = "Carregando...";
            Pontinhos.IsIndeterminate = true;
            SystemTray.SetProgressIndicator(this, Pontinhos);

            FirstLoad = true;

            NavigationInTransition navigateInTransition = new NavigationInTransition();
            navigateInTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn };
            navigateInTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardIn };

            NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
            navigateOutTransition.Backward = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardOut };
            navigateOutTransition.Forward = new TurnstileTransition { Mode = TurnstileTransitionMode.ForwardOut };
            TransitionService.SetNavigationInTransition(this, navigateInTransition);
            TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
        }
        /// <summary>
        /// Opens the page to select the date or time value
        /// </summary>
        private void OpenPickerPage(DateTimePickerType type)
        {
            string pickerPageName = type == DateTimePickerType.Date ? "DatePickerPage.xaml" : "TimePickerPage.xaml";

            Uri pickerPageUri = new System.Uri("/Microsoft.Phone.Controls.Toolkit;component/DateTimePickers/" +
                pickerPageName + "?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative);

            if (null == _frame)
            {
                // Hook up to necessary events and navigate
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;
                if (null != _frame)
                {
                    _frameContentWhenOpened = _frame.Content;

                    // Save and clear host page transitions for the upcoming "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        _savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
                        _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
                    }

                    _frame.Navigated += OnFrameNavigated;
                    _frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
                    _frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;

                    _frame.Navigate(pickerPageUri);
                }
            }
        }
예제 #47
0
        /// <summary>
        /// Handles the completion of the exit transition, automatically 
        /// continuing to bring in the new element's transition as well if it is
        /// ready.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnExitTransitionCompleted(object sender, EventArgs e)
        {
            _readyToTransitionToNewContent = true;
            _performingExitTransition = false;

            CompleteTransition(_storedNavigationOutTransition, /*_oldContentPresenter*/ null, _storedOldTransition);
            _storedNavigationOutTransition = null;
            _storedOldTransition = null;

            if (_contentReady)
            {
                ITransition newTransition = _storedNewTransition;
                NavigationInTransition navigationInTransition = _storedNavigationInTransition;

                _storedNewTransition = null;
                _storedNavigationInTransition = null;

                TransitionNewContent(newTransition, navigationInTransition);
            }
        }
예제 #48
0
        /// <summary>
        /// Handles the Navigating event of the frame, the immediate way to
        /// begin a transition out before the new page has loaded or had its
        /// layout pass.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            _isForwardNavigation = e.NavigationMode != NavigationMode.Back;

            var oldElement = Content as UIElement;
            if (oldElement == null)
            {
                return;
            }

            FlipPresenters();

            TransitionElement oldTransitionElement = null;
            NavigationOutTransition navigationOutTransition = null;
            ITransition oldTransition = null;

            navigationOutTransition = TransitionService.GetNavigationOutTransition(oldElement);

            if (navigationOutTransition != null)
            {
                oldTransitionElement = _isForwardNavigation ? navigationOutTransition.Forward : navigationOutTransition.Backward;
            }
            if (oldTransitionElement != null)
            {
                oldTransition = oldTransitionElement.GetTransition(oldElement);
            }
            if (oldTransition != null)
            {
                EnsureStoppedTransition(oldTransition);

                _storedNavigationOutTransition = navigationOutTransition;
                _storedOldTransition = oldTransition;
                oldTransition.Completed += OnExitTransitionCompleted;

                _performingExitTransition = true;

                PerformTransition(navigationOutTransition, _oldContentPresenter, oldTransition);

                PrepareContentPresenterForCompositor(_oldContentPresenter);
            }
            else
            {
                _readyToTransitionToNewContent = true;
            }
        }
예제 #49
0
        private void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            //Eingabe überprüfen
            bool faillure = false;

            Beschreibung.Background = new SolidColorBrush(Colors.Green);
            DateTime t = new DateTime();
            if (!DateTime.TryParse(Datum.Text, out t))
            {
                faillure = true;
                Datum.Background = new SolidColorBrush(Colors.Red);
            }
            else
            {
                Datum.Background = new SolidColorBrush(Colors.Green);
            }
            try
            {
                Convert.ToDouble(Note.Text);
                Note.Background = new SolidColorBrush(Colors.Green);
            }
            catch
            {
                Note.Background = new SolidColorBrush(Colors.Red);
                faillure = true;
            }
            try
            {
                Convert.ToDouble(Zählweise.Text);
                Zählweise.Background = new SolidColorBrush(Colors.Green);
            }
            catch
            {
                Zählweise.Background = new SolidColorBrush(Colors.Red);
                faillure = true;
            }
            if (faillure)
            {
                return;
            }
            else
            {
                Note n = new Note() { datum = t, note = Convert.ToDouble(Note.Text), zählweise = Convert.ToDouble(Zählweise.Text), beschreibung = Beschreibung.Text };
                if (replace)
                {
                    for (int i = 0; i < Variables.Fächer[fächerpicker.SelectedIndex].noten.Count; i++)
			        {
			            if (Variables.Fächer[fächerpicker.SelectedIndex].noten[i] == Variables.activeNote)
                        {
                            Variables.Fächer[fächerpicker.SelectedIndex].noten[i] = n;
                        }
			        }
                }
                else
                {
                    List<Fach> list = Helper.MakeFachList();
                    list[fächerpicker.SelectedIndex].noten.Add(n);
                }

                NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
                navigateOutTransition.Backward = new TurnstileFeatherTransition { Mode = TurnstileFeatherTransitionMode.BackwardOut };
                navigateOutTransition.Forward = new TurnstileFeatherTransition { Mode = TurnstileFeatherTransitionMode.BackwardOut };
                TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
                NavigationService.Navigate(new Uri("/Noten.xaml?delete=true&pivotitem=" + NavigationContext.QueryString["active"].ToString(), UriKind.Relative));
            }
        }
예제 #50
0
		public static void OpenPickerPage(DateTime selectedValue, DateTime? lowerBound, DateTime? upperBound, Action<DateTime> finished)
		{
			if (_frame != null) throw new InvalidOperationException("Picker page is already open.");

			DateTimePickerHelper.selectedValue = selectedValue.Date;
			DateTimePickerHelper.finished = finished;
			DateTimePickerHelper.lowerBound = lowerBound;
			DateTimePickerHelper.upperBound = upperBound;

			// Hook up to necessary events and navigate
			_frame = Application.Current.RootVisual as PhoneApplicationFrame;
			if (null == _frame) throw new InvalidOperationException("Cannot find PhoneApplicationFrame");

			_frameContentWhenOpened = _frame.Content;

			// Save and clear host page transitions for the upcoming "popup" navigation
			UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;
			if (null != frameContentWhenOpenedAsUIElement)
			{
				_savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
				TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
				_savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
				TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
			}

			_frame.Navigated += OnFrameNavigated;
			_frame.NavigationStopped += OnFrameNavigationStoppedOrFailed;
			_frame.NavigationFailed += OnFrameNavigationStoppedOrFailed;

			_frame.Navigate(DefaultPickerPageUri);
		}
예제 #51
0
		private static void ClosePickerPage()
		{
			// Unhook from events
			if (null != _frame)
			{
				_frame.Navigated -= OnFrameNavigated;
				_frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
				_frame.NavigationFailed -= OnFrameNavigationStoppedOrFailed;

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

				_frame = null;
				_frameContentWhenOpened = null;
			}

			// Commit the value if available
			if (null != _dateTimePickerPage)
			{
				if (_dateTimePickerPage.Value.HasValue)
				{
					finished(_dateTimePickerPage.Value.Value);
				}
				_dateTimePickerPage = null;
			}
		}
예제 #52
0
 private void Button_Tap2(object sender, System.Windows.Input.GestureEventArgs e)
 {
     Variables.activeFach.isActive = false;
     Variables.activeFach.index = 0;
     NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
     navigateOutTransition.Backward = new TurnstileFeatherTransition { Mode = TurnstileFeatherTransitionMode.BackwardOut };
     navigateOutTransition.Forward = new TurnstileFeatherTransition { Mode = TurnstileFeatherTransitionMode.BackwardOut };
     TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
     NavigationService.Navigate(new Uri("/Fachsortieren.xaml?delete=true", UriKind.Relative));
 }
예제 #53
0
 private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
 {
     e.Cancel = true;
     NavigationOutTransition navigateOutTransition = new NavigationOutTransition();
     navigateOutTransition.Backward = new TurnstileFeatherTransition { Mode = TurnstileFeatherTransitionMode.BackwardOut };
     navigateOutTransition.Forward = new TurnstileFeatherTransition { Mode = TurnstileFeatherTransitionMode.BackwardOut };
     TransitionService.SetNavigationOutTransition(this, navigateOutTransition);
     NavigationService.Navigate(new Uri("/Noten.xaml?delete=true&pivotitem=0", UriKind.Relative));
 }
예제 #54
0
 /// <summary>
 /// Sets a
 /// <see cref="T:Microsoft.Phone.Controls.NavigationTransition"/>s
 /// to
 /// <see cref="M:Microsoft.Phone.Controls.TransitionService.NavigationOutTransitionProperty"/>
 /// for a
 /// <see cref="T:System.Windows.UIElement"/>.
 /// </summary>
 /// <param name="element">The <see cref="T:System.Windows.UIElement"/>.</param>
 /// <param name="value">The <see cref="T:Microsoft.Phone.Controls.NavigationTransition"/>.</param>
 /// <returns>The </returns>
 public static void SetNavigationOutTransition(UIElement element, NavigationOutTransition value)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(NavigationOutTransitionProperty, value);
 }
예제 #55
0
        /// <summary>
        /// Handles the Navigating event of the frame, the immediate way to
        /// begin a transition out before the new page has loaded or had its
        /// layout pass.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnNavigating(object sender, NavigatingCancelEventArgs e)
        {
            // If the current application is not the origin
            // and destination of the navigation, ignore it.
            // e.g. do not play a transition when the 
            // application gets deactivated because the shell
            // will animate the frame out automatically.
            if (!e.IsNavigationInitiator)
            {
                return;
            }

            _isForwardNavigation = e.NavigationMode != NavigationMode.Back;

            var oldElement = Content as UIElement;
            if (oldElement == null)
            {
                return;
            }

            EnsureLastTransitionIsComplete();

            FlipPresenters();

            TransitionElement oldTransitionElement = null;
            NavigationOutTransition navigationOutTransition = null;
            ITransition oldTransition = null;

            navigationOutTransition = TransitionService.GetNavigationOutTransition(oldElement);

            if (navigationOutTransition != null)
            {
                oldTransitionElement = _isForwardNavigation ? navigationOutTransition.Forward : navigationOutTransition.Backward;
            }
            if (oldTransitionElement != null)
            {
                oldTransition = oldTransitionElement.GetTransition(oldElement);
            }
            if (oldTransition != null)
            {
                EnsureStoppedTransition(oldTransition);

                _storedNavigationOutTransition = navigationOutTransition;
                _storedOldTransition = oldTransition;
                oldTransition.Completed += OnExitTransitionCompleted;

                _performingExitTransition = true;

                PerformTransition(navigationOutTransition, _oldContentPresenter, oldTransition);

                PrepareContentPresenterForCompositor(_oldContentPresenter);
            }
            else
            {
                _readyToTransitionToNewContent = true;
            }
        }
예제 #56
0
        private void OpenPickerPage()
        {
            if (null == PickerPageUri)
            {
                throw new ArgumentException("PickerPageUri");
            }

            if (null == _frame)
            {
                // Hook up to necessary events and navigate
                _frame = Application.Current.RootVisual as PhoneApplicationFrame;
                if (null != _frame)
                {
                    _frameContentWhenOpened = _frame.Content;

                    // Save and clear host page transitions for the upcoming "popup" navigation
                    UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;

                    if (null != frameContentWhenOpenedAsUIElement)
                    {
                        _savedNavigationInTransition = TransitionService.GetNavigationInTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, null);
                        _savedNavigationOutTransition = TransitionService.GetNavigationOutTransition(frameContentWhenOpenedAsUIElement);
                        TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, null);
                        
                    }

                    _frame.Navigated += new NavigatedEventHandler(HandleFrameNavigated);
                    _frame.NavigationStopped += new NavigationStoppedEventHandler(HandleFrameNavigationStoppedOrFailed);
                    _frame.NavigationFailed += new NavigationFailedEventHandler(HandleFrameNavigationStoppedOrFailed);

                    _hasPickerPageOpen = true;

                    _frame.Navigate(PickerPageUri);
                }
            }
        }
        /// <summary>
        /// Closes tdate/time selection page
        /// </summary>
        private void ClosePickerPage()
        {
            // Unhook from events
            if (null != _frame)
            {
                _frame.Navigated -= OnFrameNavigated;
                _frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed;
                _frame.NavigationFailed -= OnFrameNavigationStoppedOrFailed;

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

                _frame = null;
                _frameContentWhenOpened = null;
            }

            // default result
            DateTimeResult taskResult = new DateTimeResult(TaskResult.Cancel);

            // Commit the value if available
            if (null != _dateTimePickerPage)
            {
                if (_dateTimePickerPage.Value.HasValue)
                {
                    Value = _dateTimePickerPage.Value.Value;

                    taskResult = new DateTimeResult(TaskResult.OK);
                    taskResult.Value = Value.Value;
                }
                _dateTimePickerPage = null;
            }

            this.Completed(this, taskResult);
        }
예제 #58
0
        /// <summary>
        /// Stops the last navigation transition if it's active and a new navigation occurs.
        /// </summary>
        private void EnsureLastTransitionIsComplete()
        {
            _readyToTransitionToNewContent = false;
            _contentReady = false;

            if (_performingExitTransition)
            {
                Debug.Assert(_storedOldTransition != null && _storedNavigationOutTransition != null);

                // If the app calls GoBack on NavigatedTo, we want the old content to be null
                // because you can't have the same content in two spots on the visual tree.
                _oldContentPresenter.Content = null;

                _storedOldTransition.Stop();

                _storedNavigationOutTransition = null;
                _storedOldTransition = null;

                if (_storedNewTransition != null)
                {
                    _storedNewTransition.Stop();

                    _storedNewTransition = null;
                    _storedNavigationInTransition = null;
                }

                _performingExitTransition = false;
            }
        }
예제 #59
0
        private void ClosePickerPage()
        {
            // Unhook from events
            if (null != _frame)
            {
                _frame.Navigated -= new NavigatedEventHandler(HandleFrameNavigated);
                _frame.NavigationStopped -= new NavigationStoppedEventHandler(HandleFrameNavigationStoppedOrFailed);
                _frame.NavigationFailed -= new NavigationFailedEventHandler(HandleFrameNavigationStoppedOrFailed);

                // Restore host page transitions for the completed "popup" navigation
                UIElement frameContentWhenOpenedAsUIElement = _frameContentWhenOpened as UIElement;

                if (null != frameContentWhenOpenedAsUIElement)
                {
                    TransitionService.SetNavigationInTransition(frameContentWhenOpenedAsUIElement, _savedNavigationInTransition);
                    _savedNavigationInTransition = null;
                    TransitionService.SetNavigationOutTransition(frameContentWhenOpenedAsUIElement, _savedNavigationOutTransition);
                    _savedNavigationOutTransition = null;
                }

                _frame = null;
                _frameContentWhenOpened = null;
            }

            // Commit the value if available
            if (null != _listPickerPage)
            {
                if (SelectionMode == SelectionMode.Single && null != _listPickerPage.SelectedItem)
                {
                    SelectedItem = _listPickerPage.SelectedItem;
                }
                else if ((SelectionMode == SelectionMode.Multiple || SelectionMode == SelectionMode.Extended) && null != _listPickerPage.SelectedItems)
                {
                    SelectedItems = _listPickerPage.SelectedItems;
                }
                _listPickerPage = null;
            }
        }
예제 #60
0
        /// <summary>
        /// Handles the completion of the exit transition, automatically 
        /// continuing to bring in the new element's transition as well if it is
        /// ready.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        private void OnExitTransitionCompleted(object sender, EventArgs e)
        {
            _readyToTransitionToNewContent = true;
            _performingExitTransition = false;

            if (_navigationStopped)
            {
                // Restore the old content presenter's interactivity if the navigation is cancelled.
                CompleteTransition(_storedNavigationOutTransition, _oldContentPresenter, _storedOldTransition);
                _navigationStopped = false;
            }
            else
            {
                CompleteTransition(_storedNavigationOutTransition, /*_oldContentPresenter*/ null, _storedOldTransition);
            }
            
            _storedNavigationOutTransition = null;
            _storedOldTransition = null;

            if (_contentReady)
            {
                ITransition newTransition = _storedNewTransition;
                NavigationInTransition navigationInTransition = _storedNavigationInTransition;

                _storedNewTransition = null;
                _storedNavigationInTransition = null;

                TransitionNewContent(newTransition, navigationInTransition);
            }
        }