예제 #1
0
        public void PageLeave()
        {
            DoubleAnimation OpacityAnimation = new DoubleAnimation()
            {
                From           = 1,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(1),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                }
            };

            OpacityAnimation.Completed += delegate { LeaveAction?.Invoke(); };
            this.BeginAnimation(OpacityProperty, OpacityAnimation);
        }
예제 #2
0
        public void PageLeave()
        {
            if (ContentViewer.Visibility == Visibility.Visible)
            {
                ContentViewer.BeginAnimation(OpacityProperty, new DoubleAnimation()
                {
                    From           = 1,
                    To             = 0,
                    Duration       = TimeSpan.FromSeconds(0.3),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                });
            }

            var SkillListMarginAnimation = new ThicknessAnimation()
            {
                From           = SkillListGrid.Margin,
                To             = new Thickness(-300, 100, 0, 0),
                Duration       = TimeSpan.FromSeconds(0.3),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                }
            };

            SkillListMarginAnimation.Completed += delegate
            {
                DispatcherTimer Timer = new DispatcherTimer()
                {
                    Interval = TimeSpan.FromSeconds(0.75)
                };
                Timer.Tick += delegate
                {
                    LeaveAction?.Invoke();
                    Timer.Stop();
                };
                TitleGrid.BeginAnimation(OpacityProperty, new DoubleAnimation()
                {
                    From           = 1,
                    To             = 0,
                    Duration       = TimeSpan.FromSeconds(0.75),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                });
                TitleGrid.BeginAnimation(MarginProperty, new ThicknessAnimation()
                {
                    From = TitleGrid.Margin,
                    To   = new Thickness(
                        TitleGrid.Margin.Left + 50,
                        TitleGrid.Margin.Top,
                        TitleGrid.Margin.Right - 50,
                        TitleGrid.Margin.Bottom),
                    Duration       = TimeSpan.FromSeconds(0.75),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                });
                Timer.Start();
            };
            SkillListGrid.BeginAnimation(MarginProperty, SkillListMarginAnimation);
        }
예제 #3
0
        public void PageLeave()
        {
            DispatcherTimer MenuTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(0.25)
            };
            int Count = 0;

            MenuTimer.Tick += delegate
            {
                MenuList[Count].BeginAnimation(OpacityProperty, new DoubleAnimation()
                {
                    From           = 1,
                    To             = 0,
                    Duration       = TimeSpan.FromSeconds(0.5),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                });
                var MarginAnimation = new ThicknessAnimation()
                {
                    From = MenuList[Count].Margin,
                    To   = new Thickness(
                        MenuList[Count].Margin.Left + 50,
                        MenuList[Count].Margin.Top,
                        MenuList[Count].Margin.Right,
                        MenuList[Count].Margin.Bottom),
                    Duration       = TimeSpan.FromSeconds(0.5),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                };
                if (Count == MenuList.Count - 1)
                {
                    MarginAnimation.Completed += delegate
                    {
                        DispatcherTimer FinalTimer = new DispatcherTimer()
                        {
                            Interval = TimeSpan.FromSeconds(0.75)
                        };
                        FinalTimer.Tick += delegate
                        {
                            LeaveAction?.Invoke();
                            FinalTimer.Stop();
                        };
                        TitleGrid.BeginAnimation(OpacityProperty, new DoubleAnimation()
                        {
                            From           = 1,
                            To             = 0,
                            Duration       = TimeSpan.FromSeconds(0.75),
                            EasingFunction = new ExponentialEase()
                            {
                                EasingMode = EasingMode.EaseIn
                            }
                        });
                        TitleGrid.BeginAnimation(MarginProperty, new ThicknessAnimation()
                        {
                            From = TitleGrid.Margin,
                            To   = new Thickness(
                                TitleGrid.Margin.Left + 50,
                                TitleGrid.Margin.Top,
                                TitleGrid.Margin.Right - 50,
                                TitleGrid.Margin.Bottom),
                            Duration       = TimeSpan.FromSeconds(0.75),
                            EasingFunction = new ExponentialEase()
                            {
                                EasingMode = EasingMode.EaseIn
                            }
                        });
                        FinalTimer.Start();
                    }
                }
                ;
                MenuList[Count].BeginAnimation(MarginProperty, MarginAnimation);
                Count++;
                if (Count >= MenuList.Count)
                {
                    MenuTimer.Stop();
                }
            };
            MenuTimer.Start();
        }
예제 #4
0
        public void PageLeave()
        {
            DoubleAnimation OpacityAnimation = new DoubleAnimation()
            {
                From           = 1,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.75),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                }
            };
            ThicknessAnimation MarginAnimation = new ThicknessAnimation()
            {
                From = ContentGrid.Margin,
                To   = new Thickness(
                    ContentGrid.Margin.Left + 50,
                    ContentGrid.Margin.Top,
                    ContentGrid.Margin.Right - 50,
                    ContentGrid.Margin.Bottom),
                Duration       = TimeSpan.FromSeconds(0.75),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                }
            };

            MarginAnimation.Completed += delegate
            {
                DispatcherTimer Timer = new DispatcherTimer()
                {
                    Interval = TimeSpan.FromSeconds(0.5)
                };
                Timer.Tick += delegate
                {
                    DoubleAnimation FadeAnimation = new DoubleAnimation()
                    {
                        From           = 1,
                        To             = 0,
                        Duration       = TimeSpan.FromSeconds(1),
                        EasingFunction = new ExponentialEase()
                        {
                            EasingMode = EasingMode.EaseIn
                        }
                    };
                    FadeAnimation.Completed += delegate
                    {
                        LeaveAction?.Invoke();
                    };
                    this.BeginAnimation(OpacityProperty, FadeAnimation);
                    Timer.Stop();
                };
                TitleGrid.BeginAnimation(OpacityProperty, new DoubleAnimation()
                {
                    From           = 1,
                    To             = 0,
                    Duration       = TimeSpan.FromSeconds(0.75),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                });
                TitleGrid.BeginAnimation(MarginProperty, new ThicknessAnimation()
                {
                    From = TitleGrid.Margin,
                    To   = new Thickness(
                        TitleGrid.Margin.Left + 50,
                        TitleGrid.Margin.Top,
                        TitleGrid.Margin.Right - 50,
                        TitleGrid.Margin.Bottom),
                    Duration       = TimeSpan.FromSeconds(0.75),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseIn
                    }
                });
                Timer.Start();
            };
            ContentGrid.BeginAnimation(OpacityProperty, OpacityAnimation);
            ContentGrid.BeginAnimation(MarginProperty, MarginAnimation);
        }
예제 #5
0
        public void PageLeave()
        {
            DispatcherTimer Timer = new DispatcherTimer();

            Timer.Interval = TimeSpan.FromSeconds(0.5);
            Timer.Tick    += delegate
            {
                LeaveAction?.Invoke();
                Timer.Stop();
            };

            AvatorEllipse.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = AvatorEllipse.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            MaskEllipse.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = MaskEllipse.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            NameLabel.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = NameLabel.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            NameBox.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = NameBox.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            DescriptionLabel.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = DescriptionLabel.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            DescriptionBox.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = DescriptionBox.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            BackButton.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = BackButton.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            SignupButton.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = SignupButton.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            StatusBar.BeginAnimation(OpacityProperty, new DoubleAnimation()
            {
                From           = StatusBar.Opacity,
                To             = 0,
                Duration       = TimeSpan.FromSeconds(0.5),
                EasingFunction = new ExponentialEase()
                {
                    EasingMode = EasingMode.EaseIn
                },
            });
            Timer.Start();
        }