Esempio n. 1
0
        public void DisAppear()
        {
            DetectGrid.Width  = CurrentSetting.RecoWidth;
            DetectGrid.Height = CurrentSetting.RecoHeight;

            MainGrid.Opacity = 1.0;
            OpaAni.Duration  = new Duration(TimeSpan.FromMilliseconds(500));

            Thickness ToThickness   = new Thickness(-this.Width, -this.Height, 0, 0);
            Thickness FromThickness = new Thickness(MainGrid.Margin.Left, MainGrid.Margin.Top, 0, 0);

            da.To     = ToThickness; MainGrid.Margin = ToThickness;
            OpaAni.To = 0;

            da.From     = FromThickness;
            OpaAni.From = 1.0;

            da.AccelerationRatio = 1;

            OpaAni.AccelerationRatio = 1;

            MainGrid.BeginAnimation(Grid.MarginProperty, da);
            MainGrid.BeginAnimation(Grid.OpacityProperty, OpaAni);

            MainGrid.Opacity = 0.0;
        }
Esempio n. 2
0
        public void Appear()
        {
            DetectGrid.Width  = this.Width;
            DetectGrid.Height = this.Height;

            MainGrid.Opacity = 0.0;

            Thickness ToThickness   = new Thickness(0, 0, 0, 0);
            Thickness FromThickness = new Thickness(MainGrid.Margin.Left, MainGrid.Margin.Top, 0, 0);

            da.To     = ToThickness; MainGrid.Margin = ToThickness;
            OpaAni.To = 1.0;

            da.From     = FromThickness;
            OpaAni.From = 0;

            da.AccelerationRatio     = 0;
            OpaAni.AccelerationRatio = 0;


            da.EasingFunction = new CircleEase();

            MainGrid.BeginAnimation(Grid.MarginProperty, da);
            MainGrid.BeginAnimation(Grid.OpacityProperty, OpaAni);

            MainGrid.Opacity = 1.0;
        }
Esempio n. 3
0
 // HoverCountdoen.OnMouseMover event handler [E]
 void HoverVisibility_OnMouseMove(object Data)
 {
     if (MainGrid.Opacity == 0)
     {
         MainGrid.BeginAnimation(Grid.OpacityProperty, new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(0.5))));
     }
 }
Esempio n. 4
0
        private void OnShowAllChanged()
        {
            var an = new DoubleAnimation(DC.ShowAll ? .2 : 1, TimeSpan.FromMilliseconds(200));

            MainGrid.BeginAnimation(OpacityProperty, an);
            MainGrid.IsHitTestVisible = !DC.ShowAll;
        }
        private void AssociatedObject_Loaded(object sender, RoutedEventArgs e)
        {
            SlideshowButton.Click += (s, e1) =>
            {
                var brushAnimation = new BrushAnimation();
                brushAnimation.To       = Brushes.Black;
                brushAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(800));

                GridLengthAnimation heightAnimation = new GridLengthAnimation();
                heightAnimation.To       = new GridLength(0);
                heightAnimation.From     = new GridLength(120.0);
                heightAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(500));

                GridLengthAnimation heightAnimation2 = new GridLengthAnimation();
                heightAnimation2.To       = new GridLength(0);
                heightAnimation2.From     = new GridLength(35.0);
                heightAnimation2.Duration = new Duration(TimeSpan.FromMilliseconds(500));

                heightAnimation.DecelerationRatio  = 0.5;
                heightAnimation2.DecelerationRatio = 0.5;

                MainGrid.RowDefinitions[MainGrid.RowDefinitions.Count - 1].BeginAnimation(RowDefinition.HeightProperty, heightAnimation);
                MainGrid.RowDefinitions[0].BeginAnimation(RowDefinition.HeightProperty, heightAnimation2);

                MainGrid.BeginAnimation(Grid.BackgroundProperty, brushAnimation);

                RotateButton.Visibility    = Visibility.Collapsed;
                SlideshowButton.Visibility = Visibility.Collapsed;
            };
        }
Esempio n. 6
0
 // Hover CountDown Event Handlers ---------------
 // HoverCountdown.OnTimeElapsed event hanlder [E]
 void HoverVisibility_OnTimeElapsed(object Data)
 {
     if (MainGrid.Opacity == 1)
     {
         MainGrid.BeginAnimation(Grid.OpacityProperty, new DoubleAnimation(1, 0, new Duration(TimeSpan.FromSeconds(0.5))));
     }
 }
Esempio n. 7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DoubleAnimation FadeIn = new DoubleAnimation();

            FadeIn.From     = 0;
            FadeIn.To       = 1;
            FadeIn.Duration = TimeSpan.FromSeconds(0.8);
            MainGrid.BeginAnimation(OpacityProperty, FadeIn);

            HintLogin.Width = 0;
            HintHaslo.Width = 0;
            DoubleAnimation WidthAnimation = new DoubleAnimation();

            WidthAnimation.From      = 0;
            WidthAnimation.To        = 165;
            WidthAnimation.BeginTime = TimeSpan.FromSeconds(0.3);
            WidthAnimation.Duration  = TimeSpan.FromSeconds(1.8);

            HintLogin.BeginAnimation(WidthProperty, WidthAnimation);
            HintHaslo.BeginAnimation(WidthProperty, WidthAnimation);

            FadeIn.BeginTime = TimeSpan.FromSeconds(0.3);
            FadeIn.Duration  = TimeSpan.FromSeconds(0.3);
            HintLogin.BeginAnimation(OpacityProperty, FadeIn);
            HintHaslo.BeginAnimation(OpacityProperty, FadeIn);
        }
Esempio n. 8
0
        public void SetSize(double width, double height, TimeSpan?duration = null)
        {
            var animDuration = duration ?? TransitionDuration;

            if (double.IsNaN(MainGrid.Width))
            {
                MainGrid.Width = 0;
            }
            if (double.IsNaN(MainGrid.Height))
            {
                MainGrid.Height = 0;
            }

            if (width != MainGrid.Width)
            {
                double difference = MainGrid.Width - width;

                MainGrid.BeginAnimation(WidthProperty, new DoubleAnimation(MainGrid.Width, width, animDuration)
                {
                    EasingFunction = new QuadraticEase {
                        EasingMode = EasingMode.EaseOut
                    }
                });

                if (!double.IsNaN(this.Left))
                {
                    this.BeginAnimation(LeftProperty, new DoubleAnimation(this.Left, this.Left + difference / 2, animDuration)
                    {
                        EasingFunction = new QuadraticEase {
                            EasingMode = EasingMode.EaseOut
                        },
                        FillBehavior = FillBehavior.Stop
                    });
                }
            }

            if (height != MainGrid.Height)
            {
                double difference = MainGrid.Height - height;

                MainGrid.BeginAnimation(HeightProperty, new DoubleAnimation(MainGrid.Height, height, animDuration)
                {
                    EasingFunction = new QuadraticEase {
                        EasingMode = EasingMode.EaseOut
                    }
                });

                if (!double.IsNaN(this.Top))
                {
                    this.BeginAnimation(TopProperty, new DoubleAnimation(this.Top, this.Top + difference / 2, animDuration)
                    {
                        EasingFunction = new QuadraticEase {
                            EasingMode = EasingMode.EaseOut
                        },
                        FillBehavior = FillBehavior.Stop
                    });
                }
            }
        }
Esempio n. 9
0
        public Startup()
        {
            InitializeComponent();
            var anim = new DoubleAnimation(0, 1, TimeSpan.FromMilliseconds(2000));

            anim.Completed += Anim_Completed;
            MainGrid.BeginAnimation(OpacityProperty, anim);
        }
Esempio n. 10
0
 private void CreateCredit(string a)
 {
     //MenuKey = -1;
     MainGrid.BeginAnimation(OpacityProperty, MakeAnima(1, 0, 0.3d, 0d, 0, 0, false));
     credit             = new UControl.Credit(a);
     HelpWindow.Opacity = 0;
     HelpWindow.Children.Add(credit);
     HelpWindow.BeginAnimation(OpacityProperty, MakeAnima(0, 0.8, 0.3d, 0.2d, 0, 0, false));
     credit.MouseLeftButtonUp += new MouseButtonEventHandler(help1_MouseLeftButtonUp);
     MenuLock = true;
 }
Esempio n. 11
0
 void timer_Tick(object sender, EventArgs e)
 {
     k++;
     if (k > 4)
     {
         HelpWindow.Children.Clear();
         MainGrid.BeginAnimation(OpacityProperty, MakeAnima(0, 1, 0.3d, 0.2d, 0, 0, false));
         (sender as DispatcherTimer).Stop();
         k        = 0;
         MenuLock = false;
     }
 }
        private void ControlLoaded(object sender, RoutedEventArgs e)
        {
            CurrentCD = (double)Cooldown / 1000;
            ToolTip   = SkillName;

            NumberTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMilliseconds(1000)
            };
            MainTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMilliseconds(Cooldown)
            };
            CloseTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMilliseconds(ending)
            };

            CloseTimer.Tick  += CloseTimer_Tick;
            NumberTimer.Tick += (s, o) =>
            {
                CurrentCD--;
            };
            MainTimer.Tick += (s, o) =>
            {
                var w = new DoubleAnimation(0, TimeSpan.FromMilliseconds(ending))
                {
                    EasingFunction = new QuadraticEase()
                };
                var h = new DoubleAnimation(0, TimeSpan.FromMilliseconds(ending))
                {
                    EasingFunction = new QuadraticEase()
                };
                MainGrid.BeginAnimation(WidthProperty, w);
                MainGrid.BeginAnimation(HeightProperty, h);
                CloseTimer.IsEnabled = true;

                MainTimer.Stop();
            };
            AnimateCooldown();
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            DoubleAnimation fadeInAnimation = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(2));

            MainGrid.BeginAnimation(Image.OpacityProperty, fadeInAnimation);
        }
        private void GrowGrid()
        {
            var moveAnimation = new ThicknessAnimation(new Thickness(0, 35, 0, 0), TimeSpan.FromSeconds(0.25));

            MainGrid.BeginAnimation(Grid.MarginProperty, moveAnimation);
        }