Exemplo n.º 1
0
        public static void SetIdle(FrameworkElement element, AnimationDefinition animationDefinition)
        {
            element.SetValue(IdleProperty, animationDefinition);
            element.Loaded += async (sender, args) =>
            {
                var openAnimation = GetOpen(element);
                if (openAnimation != null)
                {
                    if (openAnimation.OpacityFromZero)
                        element.Opacity = 0;

                    await element.AnimateAsync(openAnimation);
                }

                animationDefinition.Forever = true;
                await element.AnimateAsync(animationDefinition);
            };

        }
Exemplo n.º 2
0
        public static void SetIdle(FrameworkElement element, AnimationDefinition animationDefinition)
        {
            element.SetValue(IdleProperty, animationDefinition);
            element.Loaded += async(sender, args) =>
            {
                var openAnimation = GetOpen(element);
                if (openAnimation != null)
                {
                    if (openAnimation.OpacityFromZero)
                    {
                        element.Opacity = 0;
                    }

                    await element.AnimateAsync(openAnimation);
                }

                animationDefinition.Forever = true;
                await element.AnimateAsync(animationDefinition);
            };
        }
Exemplo n.º 3
0
        public static void SetOpen(FrameworkElement element, AnimationDefinition animationDefinition)
        {
            element.SetValue(OpenProperty, animationDefinition);

            if (animationDefinition.OpacityFromZero)
                element.Opacity = 0;

            element.Loaded += async (sender, args) =>
            {
                var idleDefinition = GetIdle(element);
                if (idleDefinition == null)
                {
                    await element.AnimateAsync(animationDefinition);
                }
            };
        }
Exemplo n.º 4
0
        public static void SetOpen(FrameworkElement element, AnimationDefinition animationDefinition)
        {
            element.SetValue(OpenProperty, animationDefinition);

            if (animationDefinition.OpacityFromZero)
            {
                element.Opacity = 0;
            }

            element.Loaded += async(sender, args) =>
            {
                var idleDefinition = GetIdle(element);
                if (idleDefinition == null)
                {
                    await element.AnimateAsync(animationDefinition);
                }
            };
        }
Exemplo n.º 5
0
 private static async void AnimateChangeColor(this FrameworkElement control, Color color)
 {
     var colorAni = new ColorAnimation(color, new Duration(TimeSpan.FromMilliseconds(500)));
     await control.AnimateAsync("(Panel.Background).(SolidColorBrush.Color)", colorAni);
 }