Пример #1
0
        private static void PopupShowAnimation()
        {
            if (st == null)
            {
                st = new SlideTransition();
            }
            st.Mode = SlideTransitionMode.SlideUpFadeIn;
            ITransition transition = st.GetTransition(_popUp.Child);

            transition.Completed += delegate {
                transition.Stop();
            };
            transition.Begin();
            _popUp.Child.Opacity = 1;
        }
Пример #2
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // hack to always enable the Venue textbox if it has been disabled in the event the user clicks search while keyboard is showing
            this.BackKeyPress += EnableVenueTextBox;

            IDictionary <string, string> parameters = this.NavigationContext.QueryString;

            if (parameters.ContainsKey("DateId"))
            {
                DateId = Int32.Parse(parameters["DateId"]);
            }

            base.OnNavigatedTo(e);

            if (e.NavigationMode != NavigationMode.Back)
            {
                SlideTransition transition = new SlideTransition();
                transition.Mode = SlideTransitionMode.SlideRightFadeIn;

                PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
                ITransition          trans = transition.GetTransition(page);

                trans.Completed += delegate
                {
                    trans.Stop();

                    if (e.NavigationMode == NavigationMode.New)
                    {
                        ceDateViewModel  = new CEDateViewModel(this, DateId);
                        this.DataContext = ceDateViewModel;
                    }
                };
                trans.Begin();
            }
        }
Пример #3
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.NavigationMode != NavigationMode.Back)
            {
                SlideTransition transition = new SlideTransition();
                transition.Mode = SlideTransitionMode.SlideRightFadeIn;

                PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
                ITransition          trans = transition.GetTransition(page);

                trans.Completed += delegate
                {
                    trans.Stop();

                    if (e.NavigationMode == NavigationMode.New)
                    {
                        addPersonViewModel = new AddPersonViewModel(this);
                        this.DataContext   = addPersonViewModel;
                    }
                };
                trans.Begin();
            }
        }
Пример #4
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            IDictionary <string, string> parameters = this.NavigationContext.QueryString;

            if (parameters.ContainsKey("PersonId"))
            {
                PersonId = Int32.Parse(parameters["PersonId"]);
            }

            base.OnNavigatedTo(e);

            if (e.NavigationMode != NavigationMode.Back)
            {
                SlideTransition transition = new SlideTransition();
                transition.Mode = SlideTransitionMode.SlideRightFadeIn;

                PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
                ITransition          trans = transition.GetTransition(page);

                trans.Completed += delegate
                {
                    trans.Stop();

                    if (e.NavigationMode == NavigationMode.New)
                    {
                        cePersonViewModel = new CEPersonViewModel(this, PersonId);
                        this.DataContext  = cePersonViewModel;
                    }
                };
                trans.Begin();
            }
        }
Пример #5
0
        private void toggleMode()
        {
            SlideTransition st = new SlideTransition {
                Mode = (keysHidden) ? SlideTransitionMode.SlideUpFadeIn : SlideTransitionMode.SlideDownFadeOut
            };
            ITransition it = st.GetTransition(ContentPanel);

            it.Completed += (s, eventargs) =>
            {
                it.Stop();
                if (!keysHidden)
                {
                    lstHist.Visibility = System.Windows.Visibility.Visible;
                    grdKeys.Visibility = System.Windows.Visibility.Collapsed;
                }
                try
                {
                    BitmapImage img = new BitmapImage(new Uri(((keysHidden) ? "/images/down.png" : "/images/up.png"), UriKind.Relative));
                    imgToggleKeys.Source = img;
                }
                catch (Exception ex) { MessageBox.Show(ex.Message); }
                keysHidden = !keysHidden;
            };
            if (keysHidden)
            {
                lstHist.Visibility = System.Windows.Visibility.Collapsed; grdKeys.Visibility = System.Windows.Visibility.Visible;
            }
            it.Begin();
        }
Пример #6
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            SlideTransition transition = new SlideTransition();

            transition.Mode = SlideTransitionMode.SlideRightFadeIn;
            PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
            ITransition          trans = transition.GetTransition(page);

            trans.Completed += delegate
            {
                trans.Stop();
            };
            trans.Begin();

            if (e.NavigationMode == NavigationMode.Back)
            {
                var id = (this.DataContext as TournViewModel).TournId;
                DataContext = null;
                DataContext = new TournViewModel();
                (this.DataContext as TournViewModel).TournId = id;
                return;
            }
            string parameterValue = NavigationContext.QueryString["param1"];

            int tournId;

            if (!Int32.TryParse(parameterValue, out tournId))
            {
                throw new NotImplementedException();
            }

            (this.DataContext as TournViewModel).TournId = tournId;
        }
Пример #7
0
        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            if (AppHelper.AppEff)
            {
                SlideTransitionMode slideTransitionMode = (SlideTransitionMode)Enum.Parse(typeof(SlideTransitionMode), "SlideDownFadeOut", false);
                TransitionElement   transitionElement   = new SlideTransition {
                    Mode = slideTransitionMode
                };

                PhoneApplicationPage phoneApplicationPage = (PhoneApplicationPage)(((PhoneApplicationFrame)Application.Current.RootVisual)).Content;

                ITransition transition = transitionElement.GetTransition(phoneApplicationPage);
                transition.Completed += delegate { transition.Stop(); };
                transition.Begin();
            }
        }
Пример #8
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            IDictionary <string, string> parameters = this.NavigationContext.QueryString;

            if (parameters.ContainsKey("DateId"))
            {
                DateId = parameters["DateId"];
            }


            if (e.NavigationMode != NavigationMode.Back)
            {
                SlideTransition transition = new SlideTransition();
                transition.Mode = SlideTransitionMode.SlideRightFadeIn;

                PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
                ITransition          trans = transition.GetTransition(page);

                trans.Completed += delegate
                {
                    trans.Stop();

                    if (e.NavigationMode == NavigationMode.New)
                    {
                        editDateViewModel = new EditDateViewModel(Int32.Parse(DateId), this);
                        this.DataContext  = editDateViewModel;

                        DoubleLoopingDataSource doubleLoopingDataSource = new DoubleLoopingDataSource()
                        {
                            MinValue = 0, MaxValue = 5, SelectedItem = editDateViewModel.EditDate.Rating
                        };
                        doubleLoopingDataSource.SelectionChanged += new EventHandler <SelectionChangedEventArgs>(LoopingSelector_SelectionChanged);

                        IntLoopingDataSource intLoopingDataSource = new IntLoopingDataSource()
                        {
                            MinValue = 0, MaxValue = 10, SelectedItem = editDateViewModel.EditDate.Rating
                        };
                        intLoopingDataSource.SelectionChanged += new EventHandler <SelectionChangedEventArgs>(LoopingSelector_SelectionChanged);
                        this.selector.DataSource = doubleLoopingDataSource;
                    }
                };
                trans.Begin();
            }
        }
Пример #9
0
        // Load data for the ViewModel Items
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            SlideTransition transition = new SlideTransition();

            transition.Mode = SlideTransitionMode.SlideRightFadeIn;
            PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
            ITransition          trans = transition.GetTransition(page);

            trans.Completed += delegate
            {
                trans.Stop();
            };
            trans.Begin();
            //if (!App.ViewModel.IsDataLoaded)
            //{
            //    App.ViewModel.LoadData();
            //}
        }
        // Избранное
        private void AppList_Click_1(object sender, EventArgs e)
        {
            NavigationService.Navigate(new Uri("/Pages/ListPage.xaml", UriKind.Relative));

            if (AppHelper.AppEff)
            {
                SlideTransitionMode slideTransitionMode = (SlideTransitionMode)Enum.Parse(typeof(SlideTransitionMode), "SlideDownFadeOut", false);
                TransitionElement   transitionElement   = new SlideTransition {
                    Mode = slideTransitionMode
                };

                PhoneApplicationPage phoneApplicationPage = (PhoneApplicationPage)(((PhoneApplicationFrame)Application.Current.RootVisual)).Content;

                ITransition transition = transitionElement.GetTransition(phoneApplicationPage);
                transition.Completed += delegate { transition.Stop(); };
                transition.Begin();
            }
        }
Пример #11
0
        private void AppBarButtonNextDay_Click(object sender, EventArgs e)
        {
            inTransition = false;
            var transitionOut = new SlideTransition {
                Mode = SlideTransitionMode.SlideLeftFadeOut
            };
            var transitionIn = new SlideTransition {
                Mode = SlideTransitionMode.SlideLeftFadeIn
            };
            var pivotItem = (PivotItem)MainPivot.SelectedItem;
            var tran      = transitionOut.GetTransition(pivotItem);

            tran.Completed += (o, args) =>
            {
                currentDate = currentDate.AddDays(1);
                LoadData(AppSettings.NumberOfStarts, transitionIn.GetTransition(pivotItem));
            };
            tran.Begin();
        }
Пример #12
0
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && items != null && items.Count > 0)
            {
                bool increase = e.HorizontalVelocity > 0;//? "Right" : "Left";

                SlideTransition sTx = new SlideTransition();
                sTx.Mode = !increase ? SlideTransitionMode.SlideLeftFadeIn : SlideTransitionMode.SlideRightFadeIn;
                ITransition transition = sTx.GetTransition(htmlBlock);
                transition.Completed += delegate
                {
                    transition.Stop();
                };
                transition.Begin();



                if (!increase)
                {
                    if (position < items.Count - 1)
                    {
                        position++;
                    }
                    else
                    {
                        position = 0;//we do a loop
                    }
                }
                else
                {
                    if (position > 0)
                    {
                        position--;
                    }
                    else
                    {
                        position = items.Count - 1;//we do a loop
                    }
                }
                showItem();
                //
            }
        }
Пример #13
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            App.ViewModel.LoadData(true);

            base.OnNavigatedTo(e);
            SlideTransition transition = new SlideTransition();

            transition.Mode = SlideTransitionMode.SlideRightFadeIn;
            PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
            ITransition          trans = transition.GetTransition(page);

            trans.Completed += delegate
            {
                RefreshList();
                DrawLongListSelector();
                trans.Stop();
            };
            trans.Begin();
        }
Пример #14
0
        private void StartTransitionRigthFadeIn()
        {
            //RotateTransition rotatetransition = new RotateTransition();
            //rotatetransition.Mode = RotateTransitionMode.In90Clockwise;

            SlideTransition slideTransition = new SlideTransition();

            slideTransition.Mode = SlideTransitionMode.SlideRightFadeIn;

            PhoneApplicationPage phoneApplicationPage =
                (PhoneApplicationPage)(((PhoneApplicationFrame)Application.Current.RootVisual)).Content;

            ITransition transition = slideTransition.GetTransition(phoneApplicationPage);

            transition.Completed += delegate
            {
                transition.Stop();
            };
            transition.Begin();
            myStoryboard.Begin();
        }
Пример #15
0
        internal void Toggle()
        {
            var    platform  = Element.Platform as Platform;
            Canvas container = platform.GetCanvas();

            if (_toggleTransition != null)
            {
                return;
            }

            if (Visible)
            {
                _toggleTransition = _outTransition.GetTransition(_popup);
                _toggleTransition.Begin();
                _toggleTransition.Completed += (sender, args) =>
                {
                    _toggleTransition.Stop();
                    container.Children.Remove(_popup);
                    _toggleTransition = null;
                };
            }
            else
            {
                _popup.Child = _masterRenderer.ContainerElement;
                container.Children.Add(_popup);

                _toggleTransition = _inTransition.GetTransition(_popup);
                _toggleTransition.Begin();

                _toggleTransition.Completed += (sender, args) =>
                {
                    _toggleTransition.Stop();
                    _toggleTransition = null;
                };
            }

            Visible = !Visible;

            ((IElementController)Element).SetValueFromRenderer(MasterDetailPage.IsPresentedProperty, Visible);
        }
Пример #16
0
        public static void SlideToPage(this Panorama self, int item)
        {
            var slide_transition = new SlideTransition()
            {
            };

            slide_transition.Mode = SlideTransitionMode.SlideRightFadeOut;
            ITransition transition = slide_transition.GetTransition(self);

            transition.Completed += delegate
            {
                self.DefaultItem = self.Items[item];

                //PanoramaItem panItem = (PanoramaItem)self.Items[1];

                //self.Items.Remove(panItem);

                //self.Items.Insert(0, panItem);
                transition.Stop();
            };
            transition.Begin();
        }