Example #1
0
        public DoubleAnimation GenerateBgiRotateAnimation()
        {
            DoubleAnimation Animation = new DoubleAnimation()
            {
                From     = 0,
                To       = 360,
                Duration = TimeSpan.FromSeconds(30)
            };

            Animation.Completed += delegate
            {
                BgiRotateTransform.BeginAnimation(RotateTransform.AngleProperty, GenerateBgiRotateAnimation());
            };
            return(Animation);
        }
Example #2
0
        public void PageEnter(bool Login = false)
        {
            BgiRotateTransform.BeginAnimation(RotateTransform.AngleProperty, GenerateBgiRotateAnimation());
            if (Login)
            {
                MainWindow.Instance.ShowInfoGrid(true);
                DispatcherTimer DelayTimer = new DispatcherTimer()
                {
                    Interval = TimeSpan.FromSeconds(0.5)
                };
                DelayTimer.Tick += delegate
                {
                    DoubleAnimation OpacityAnimation = new DoubleAnimation()
                    {
                        From           = 0,
                        To             = 1,
                        Duration       = TimeSpan.FromSeconds(1),
                        EasingFunction = new ExponentialEase()
                        {
                            EasingMode = EasingMode.EaseOut
                        }
                    };
                    OpacityAnimation.Completed += delegate
                    {
                        var RingAnimation = new ThicknessAnimation()
                        {
                            From           = OrnamentRing.Margin,
                            To             = new Thickness(275, 0, 0, 0),
                            Duration       = TimeSpan.FromSeconds(0.5),
                            EasingFunction = new ExponentialEase()
                            {
                                EasingMode = EasingMode.EaseOut
                            }
                        };
                        RingAnimation.Completed += delegate
                        {
                            DispatcherTimer MenuTimer = new DispatcherTimer()
                            {
                                Interval = TimeSpan.FromSeconds(0.25)
                            };
                            int Count = 0;
                            MenuTimer.Tick += delegate
                            {
                                MenuList[Count].BeginAnimation(OpacityProperty, new DoubleAnimation()
                                {
                                    From           = 0,
                                    To             = 1,
                                    Duration       = TimeSpan.FromSeconds(0.5),
                                    EasingFunction = new ExponentialEase()
                                    {
                                        EasingMode = EasingMode.EaseOut
                                    }
                                });
                                MenuList[Count].BeginAnimation(MarginProperty, new ThicknessAnimation()
                                {
                                    From = new Thickness(
                                        MenuList[Count].Margin.Left - 50,
                                        MenuList[Count].Margin.Top,
                                        MenuList[Count].Margin.Right,
                                        MenuList[Count].Margin.Bottom),
                                    To             = MenuList[Count].Margin,
                                    Duration       = TimeSpan.FromSeconds(0.5),
                                    EasingFunction = new ExponentialEase()
                                    {
                                        EasingMode = EasingMode.EaseOut
                                    }
                                });
                                Count++;
                                if (Count >= MenuList.Count)
                                {
                                    MenuTimer.Stop();
                                }
                            };
                            MenuTimer.Start();
                        };
                        OrnamentRing.BeginAnimation(MarginProperty, RingAnimation);
                    };
                    this.BeginAnimation(OpacityProperty, OpacityAnimation);
                    DelayTimer.Stop();
                };
                DelayTimer.Start();
            }
            else
            {
                MainWindow.Instance.InfoGrid.Init();

                DoubleAnimation OpacityAnimation = new DoubleAnimation()
                {
                    From           = 0,
                    To             = 1,
                    Duration       = TimeSpan.FromSeconds(1),
                    EasingFunction = new ExponentialEase()
                    {
                        EasingMode = EasingMode.EaseOut
                    }
                };
                OpacityAnimation.Completed += delegate
                {
                    var RingAnimation = new ThicknessAnimation()
                    {
                        From           = OrnamentRing.Margin,
                        To             = new Thickness(275, 0, 0, 0),
                        Duration       = TimeSpan.FromSeconds(0.5),
                        EasingFunction = new ExponentialEase()
                        {
                            EasingMode = EasingMode.EaseOut
                        }
                    };
                    RingAnimation.Completed += delegate
                    {
                        DispatcherTimer MenuTimer = new DispatcherTimer()
                        {
                            Interval = TimeSpan.FromSeconds(0.25)
                        };
                        int Count = 0;
                        MenuTimer.Tick += delegate
                        {
                            MenuList[Count].BeginAnimation(OpacityProperty, new DoubleAnimation()
                            {
                                From           = 0,
                                To             = 1,
                                Duration       = TimeSpan.FromSeconds(0.5),
                                EasingFunction = new ExponentialEase()
                                {
                                    EasingMode = EasingMode.EaseOut
                                }
                            });
                            MenuList[Count].BeginAnimation(MarginProperty, new ThicknessAnimation()
                            {
                                From = new Thickness(
                                    MenuList[Count].Margin.Left - 50,
                                    MenuList[Count].Margin.Top,
                                    MenuList[Count].Margin.Right,
                                    MenuList[Count].Margin.Bottom),
                                To             = MenuList[Count].Margin,
                                Duration       = TimeSpan.FromSeconds(0.5),
                                EasingFunction = new ExponentialEase()
                                {
                                    EasingMode = EasingMode.EaseOut
                                }
                            });
                            Count++;
                            if (Count >= MenuList.Count)
                            {
                                MenuTimer.Stop();
                            }
                        };
                        MenuTimer.Start();
                    };
                    OrnamentRing.BeginAnimation(MarginProperty, RingAnimation);
                };
                this.BeginAnimation(OpacityProperty, OpacityAnimation);
            }
        }