Exemplo n.º 1
0
        private void VkontakteButton_MouseEnter(object sender, MouseEventArgs e)
        {
            DoubleAnimation OpacityAnimation = new DoubleAnimation();

            OpacityAnimation.From     = VkontakteLabel.Opacity;
            OpacityAnimation.To       = 1;
            OpacityAnimation.Duration = TimeSpan.FromSeconds(0.1);

            TranslateTransform Transform = new TranslateTransform();

            Vkontakte.RenderTransform = Transform;
            DoubleAnimation MarginAnimation = new DoubleAnimation();

            MarginAnimation.From     = Vkontakte.Margin.Right;
            MarginAnimation.To       = 80;
            MarginAnimation.Duration = TimeSpan.FromSeconds(0.5);

            Vkontakte.BeginAnimation(Border.OpacityProperty, OpacityAnimation);
            Transform.BeginAnimation(TranslateTransform.XProperty, MarginAnimation);
        }
Exemplo n.º 2
0
        private void VkontakteButton_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation OpacityAnimation = new DoubleAnimation();

            OpacityAnimation.From     = VkontakteLabel.Opacity;
            OpacityAnimation.To       = 0.5;
            OpacityAnimation.Duration = TimeSpan.FromSeconds(0.1);

            short Right = (short)Canvas.GetRight(Vkontakte);
            TranslateTransform Transform = new TranslateTransform();

            Vkontakte.RenderTransform = Transform;
            DoubleAnimation MarginAnimation = new DoubleAnimation();

            MarginAnimation.From     = Vkontakte.Margin.Right;
            MarginAnimation.To       = 0;
            MarginAnimation.Duration = TimeSpan.FromSeconds(0.4);
            Transform.BeginAnimation(TranslateTransform.XProperty, MarginAnimation);

            Vkontakte.BeginAnimation(Border.OpacityProperty, OpacityAnimation);
            VkontakteLabel.Foreground = Brushes.White;
        }