Пример #1
0
        private void ActivatorOnMouseEnter(object sender, MouseEventArgs e)
        {
            Slider.IsHitTestVisible = true;

            _opacityMaskScaleExpandAnim.To = Slider.ActualWidth / 40D;
            OpacityMaskRect.RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, _opacityMaskScaleExpandAnim);

            _sliderBackgroundWidthExpandAnim.To = Slider.ActualWidth;
            SliderBackgroundBorder.BeginAnimation(FrameworkElement.WidthProperty, _sliderBackgroundWidthExpandAnim);

            ((DropShadowEffect)SliderBackgroundBorder.Effect).BeginAnimation(DropShadowEffect.OpacityProperty, _effectOnAnim);
            SliderBackgroundBorder.Background.BeginAnimation(SolidColorBrush.ColorProperty,
                                                             new ColorAnimation(Color.FromRgb(53, 61, 66), TimeSpan.FromMilliseconds(200)));
        }
Пример #2
0
        private void ActivatorOnMouseLeave(object sender, MouseEventArgs e)
        {
            if (Slider.IsMouseOver)
            {
                return;
            }
            Slider.IsHitTestVisible = false;

            OpacityMaskRect.RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, _opacityMaskScaleShrinkAnim);

            SliderBackgroundBorder.BeginAnimation(FrameworkElement.WidthProperty, _sliderBackgroundWidthShrinkAnim);

            ((DropShadowEffect)SliderBackgroundBorder.Effect).BeginAnimation(DropShadowEffect.OpacityProperty, _effectOffAnim);

            SliderBackgroundBorder.Background.BeginAnimation(SolidColorBrush.ColorProperty,
                                                             new ColorAnimation(Color.FromRgb(45, 52, 56), TimeSpan.FromMilliseconds(200)));
        }