Beispiel #1
0
        private void OnShrink(object sender, RoutedEventArgs e)
        {
            var widthAnimation = new DoubleAnimation {
                Duration = TimeSpan.FromSeconds(5)
            };
            var heightAnimation = new DoubleAnimation {
                Duration = TimeSpan.FromSeconds(5)
            };

            GrowButton.BeginAnimation(WidthProperty, widthAnimation);
            GrowButton.BeginAnimation(HeightProperty, heightAnimation);
        }
Beispiel #2
0
        private void OnGrow(object sender, RoutedEventArgs e)
        {
            var widthAnimation = new DoubleAnimation
            {
                To       = Width - 30,
                Duration = TimeSpan.FromSeconds(5)
            };

            widthAnimation.Completed += OnAnimationCompleted;

            var heightAnimation = new DoubleAnimation
            {
                To       = (Height - 50) / 3,
                Duration = TimeSpan.FromSeconds(5)
            };

            GrowButton.BeginAnimation(WidthProperty, widthAnimation);
            GrowButton.BeginAnimation(HeightProperty, heightAnimation);
        }