private void RectangularContent_MouseDown(object sender, MouseButtonEventArgs e) { DoubleAnimation OpacityAnimation = new DoubleAnimation(); OpacityAnimation.From = RectangularContent.Opacity; OpacityAnimation.To = 0.8d; OpacityAnimation.Duration = TimeSpan.FromMilliseconds(200); RectangularContent.BeginAnimation(OpacityProperty, OpacityAnimation); DoubleAnimation circulator_dissappearing = new DoubleAnimation(); circulator_dissappearing.From = Circulator.Opacity; circulator_dissappearing.To = 1; circulator_dissappearing.Duration = TimeSpan.FromMilliseconds(100); circulator_dissappearing.EasingFunction = new ExponentialEase(); Circulator.BeginAnimation(OpacityProperty, circulator_dissappearing); DoubleAnimation increment = new DoubleAnimation(0, 200, new Duration(TimeSpan.FromMilliseconds(800))); increment.EasingFunction = new QuarticEase(); Circulator.BeginAnimation(WidthProperty, increment); Circulator.BeginAnimation(HeightProperty, increment); }
private void RectangularContent_MouseDown(object sender, MouseButtonEventArgs e) { DoubleAnimation OpacityAnimation = new DoubleAnimation(); OpacityAnimation.From = Opacity; OpacityAnimation.To = 0.8d; OpacityAnimation.Duration = TimeSpan.FromMilliseconds(200); BeginAnimation(OpacityProperty, OpacityAnimation); //This line of code is very stupid //Circulator.Margin = new Thickness(Mouse.GetPosition(this).X, Mouse.GetPosition(this).Y, Mouse.GetPosition(this).X, Mouse.GetPosition(this).Y); DoubleAnimation circulator_dissappearing = new DoubleAnimation(); circulator_dissappearing.From = Circulator.Opacity; circulator_dissappearing.To = 1; circulator_dissappearing.Duration = TimeSpan.FromMilliseconds(100); circulator_dissappearing.EasingFunction = new ExponentialEase(); Circulator.BeginAnimation(OpacityProperty, circulator_dissappearing); DoubleAnimation increment = new DoubleAnimation(0, 200, new Duration(TimeSpan.FromMilliseconds(800))); increment.EasingFunction = new QuarticEase(); Circulator.BeginAnimation(WidthProperty, increment); Circulator.BeginAnimation(HeightProperty, increment); }
private void RectangularContent_MouseUp(object sender, MouseButtonEventArgs e) { DoubleAnimation OpacityAnimation = new DoubleAnimation(); OpacityAnimation.From = RectangularContent.Opacity; OpacityAnimation.To = 1; OpacityAnimation.Duration = TimeSpan.FromMilliseconds(200); RectangularContent.BeginAnimation(OpacityProperty, OpacityAnimation); DoubleAnimation circulator_dissappearing = new DoubleAnimation(); circulator_dissappearing.From = Circulator.Opacity; circulator_dissappearing.To = 0; circulator_dissappearing.Duration = TimeSpan.FromMilliseconds(400); circulator_dissappearing.EasingFunction = new ExponentialEase(); Circulator.BeginAnimation(OpacityProperty, circulator_dissappearing); }