Ejemplo n.º 1
0
        private static void OnGradualInChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue as bool? != true)
            {
                return;
            }

            var element    = d as FrameworkElement;
            var collection = new GradientStopCollection();

            var stop1 = new GradientStop()
            {
                Offset = 0, Color = Colors.White
            };
            var stop2 = new GradientStop()
            {
                Offset = 0, Color = Colors.Transparent
            };

            collection.Add(stop1);
            collection.Add(stop2);

            var brush = new LinearGradientBrush()
            {
                StartPoint    = new Point(0, 0),
                EndPoint      = new Point(0, 1),
                GradientStops = collection,
            };

            element.OpacityMask = brush;

            if (element.IsLoaded)
            {
                var duration       = GetDurationSeconds(element);
                var beginSeconds   = GetBeginTimeSeconds(element);
                var easingFunction = GetEasingFunction(element);

                stop2.BeginAnimation(GradientStop.OffsetProperty, GetDoubleAnimation(1, TimeSpan.FromSeconds(duration), element, TimeSpan.FromSeconds(beginSeconds), easingFunction));
                stop2.BeginAnimation(GradientStop.ColorProperty, GetColorAnimation(Colors.White, TimeSpan.FromSeconds(duration / 0.5), element, TimeSpan.FromSeconds(duration * 0.75), easingFunction));
            }
            else
            {
                element.Loaded += delegate
                {
                    var duration       = GetDurationSeconds(element);
                    var beginSeconds   = GetBeginTimeSeconds(element);
                    var easingFunction = GetEasingFunction(element);
                    stop2.BeginAnimation(GradientStop.OffsetProperty, GetDoubleAnimation(1, TimeSpan.FromSeconds(duration), element, TimeSpan.FromSeconds(beginSeconds), easingFunction));
                    stop2.BeginAnimation(GradientStop.ColorProperty, GetColorAnimation(Colors.White, TimeSpan.FromSeconds(duration / 0.5), element, TimeSpan.FromSeconds(duration * 0.75), easingFunction));
                };
            }
            SetGradualIn(element, false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Color animation for WPF controls
        /// </summary>
        /// <param name="element"></param>
        /// <param name="color"></param>
        public static void ColorAnimation(this Shape element, Color color, Color colorMid)
        {
            //Height animation
            GradientStop sc1 = null; GradientStop sc2 = null;

            if (element != null)
            {
                var solidColorBrush = element.Fill as GradientBrush;
                if (solidColorBrush != null)
                {
                    sc1 = solidColorBrush.GradientStops[0];
                    sc2 = solidColorBrush.GradientStops[1];
                }



                ColorAnimation ColorAnim3 = new ColorAnimation();
                ColorAnim3.To       = color;
                ColorAnim3.Duration = TimeSpan.FromSeconds(2);

                sc1.BeginAnimation(GradientStop.ColorProperty, ColorAnim3);

                ColorAnimation ColorAnim1 = new ColorAnimation();
                ColorAnim1.To       = colorMid;
                ColorAnim1.Duration = TimeSpan.FromSeconds(2);

                sc2.BeginAnimation(GradientStop.ColorProperty, ColorAnim1);
            }
        }
Ejemplo n.º 3
0
        public static LinearGradientBrush PartitionBackground(bool aero)
        {
            LinearGradientBrush ln = new LinearGradientBrush();

            ln.Transform = new RotateTransform(90);

            var TC = ((SolidColorBrush)App.Current.FindResource((aero) ? "PrimaryBrush" : "AeroBrush")).Color;

            //Top Color
            GradientStop C1 = new GradientStop();

            C1.Color = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((!aero) ? 0 : 1))
            };
            ln.GradientStops.Add(C1);

            //Bottom Color
            GradientStop C3 = new GradientStop();

            C3.Color = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((!aero) ? 0 : 1))
            };
            C3.Offset = 1;
            ln.GradientStops.Add(C3);

            TC = ((SolidColorBrush)App.Current.FindResource((!aero) ? "PrimaryBrush" : "AeroBrush")).Color;

            ColorAnimation ColorAnim3 = new ColorAnimation();

            ColorAnim3.To = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((aero) ? 0 : 1))
            };
            ColorAnim3.Duration       = TimeSpan.FromSeconds(.25);
            ColorAnim3.EasingFunction = new PowerEase()
            {
                EasingMode = EasingMode.EaseIn
            };
            C3.BeginAnimation(GradientStop.ColorProperty, ColorAnim3);


            ColorAnimation ColorAnim1 = new ColorAnimation();

            ColorAnim1.To = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((aero) ? 0 : 1))
            };
            ColorAnim1.Duration       = TimeSpan.FromSeconds(.25);
            ColorAnim1.EasingFunction = new CircleEase()
            {
                EasingMode = EasingMode.EaseOut
            };
            C1.BeginAnimation(GradientStop.ColorProperty, ColorAnim1);

            return(ln);
        }
Ejemplo n.º 4
0
        public void refreshData()
        {
            RaisePropertyChanged(() => valuecolor);
            RaisePropertyChanged(() => scale);
            RaisePropertyChanged(() => info);

            DoubleAnimation ani = new DoubleAnimation(scale, TimeSpan.FromSeconds(0.2), FillBehavior.HoldEnd);

            gstep1.BeginAnimation(GradientStop.OffsetProperty, ani);
            gstep2.BeginAnimation(GradientStop.OffsetProperty, ani);
        }
Ejemplo n.º 5
0
        protected internal override void BeginTransition(TransitionPresenter transitionElement, ContentPresenter oldContent, ContentPresenter newContent)
        {
            LinearGradientBrush gb = new LinearGradientBrush();

            GradientStop gs_gs1 = new GradientStop(SolidColorBrushConverter.ToColor("#FF000000"), 0);
            GradientStop gs_gs2 = new GradientStop(SolidColorBrushConverter.ToColor("#00000000"), 0);

            gb.GradientStops.Add(gs_gs1);
            gb.GradientStops.Add(gs_gs2);

            Point StartPoint = new Point(0, 0);
            Point EndPoint   = new Point(0, 1);

            switch (Direction)
            {
            case AyTransitionDirection.down:
                StartPoint = new Point(0, 0);
                EndPoint   = new Point(0, 1);
                break;

            case AyTransitionDirection.up:
                StartPoint = new Point(0, 1);
                EndPoint   = new Point(0, 0);
                break;

            case AyTransitionDirection.left:
                StartPoint = new Point(0, 0);
                EndPoint   = new Point(1, 0);
                break;

            case AyTransitionDirection.right:
                StartPoint = new Point(1, 0);
                EndPoint   = new Point(0, 0);
                break;
            }
            gb.StartPoint          = StartPoint;
            gb.EndPoint            = EndPoint;
            oldContent.OpacityMask = gb;

            DoubleAnimation da1 = new DoubleAnimation();

            da1.From     = 0;
            da1.To       = 1;
            da1.Duration = Duration;
            gs_gs1.BeginAnimation(GradientStop.OffsetProperty, da1);
            DoubleAnimation da2 = new DoubleAnimation();

            da2.From      = 0;
            da2.To        = 1;
            da2.Duration  = Duration;
            da2.BeginTime = TimeSpan.FromMilliseconds(50);
            gs_gs2.BeginAnimation(GradientStop.OffsetProperty, da2);
        }
Ejemplo n.º 6
0
        private void JButton_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            // OffsetColor = Colors.White;

            GradientStop gradientStop = (GradientStop)Template.FindName("offset", this);

            if (gradientStop == null)
            {
                return;
            }
            var colorAnimation = new ColorAnimation(
                Colors.White,
                new Duration(TimeSpan.FromMilliseconds(150)))
            {
                FillBehavior = FillBehavior.HoldEnd
            };

            gradientStop.BeginAnimation(GradientStop.ColorProperty, colorAnimation);
            //XPosition = e.GetPosition(this).X;
            //YPosition = e.GetPosition(this).Y;
        }
Ejemplo n.º 7
0
        private void JButton_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            //double x = e.GetPosition(this).X;
            //double y = e.GetPosition(this).Y;

            //XPosition = x > ActualWidth/2 ? ActualWidth : 0;
            //YPosition = y > ActualHeight/2 ? ActualHeight : 0;
            GradientStop gradientStop = (GradientStop)Template.FindName("offset", this);

            if (gradientStop == null)
            {
                return;
            }
            var colorAnimation = new ColorAnimation(Colors.Transparent,

                                                    new Duration(TimeSpan.FromMilliseconds(150)))
            {
                BeginTime    = TimeSpan.FromMilliseconds(50),
                FillBehavior = FillBehavior.HoldEnd
            };

            gradientStop.BeginAnimation(GradientStop.ColorProperty, colorAnimation);
        }
        static async void ValueChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            int SECONDS_DISABLED = 5;

            TempDisableBorder item = sender as TempDisableBorder;

            if (item == null || item.AssociatedObject == null)
            {
                return;
            }

            Color  successColor            = (Color)ColorConverter.ConvertFromString("#63AB51");
            Border borderItem              = item.AssociatedObject as Border;
            LinearGradientBrush background = new LinearGradientBrush();

            background.StartPoint = new Point(0, 0.5);
            background.EndPoint   = new Point(1, 0.5);

            GradientStop firstStop  = new GradientStop(successColor, 0);
            GradientStop middleStop = new GradientStop(Colors.Gray, 0);
            GradientStop lastStop   = new GradientStop(Colors.Gray, 1);

            background.GradientStops.Add(firstStop);
            background.GradientStops.Add(middleStop);
            background.GradientStops.Add(lastStop);
            borderItem.Background = background;

            DoubleAnimation animate = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(SECONDS_DISABLED));

            firstStop.BeginAnimation(GradientStop.OffsetProperty, animate);
            middleStop.BeginAnimation(GradientStop.OffsetProperty, animate);

            borderItem.IsHitTestVisible = false;
            await Task.Delay(TimeSpan.FromSeconds(SECONDS_DISABLED));

            borderItem.IsHitTestVisible = true;
        }
Ejemplo n.º 9
0
        public static void PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TextBlock    element = (TextBlock)d;
            PlaylistItem curr    = (PlaylistItem)element.GetValue(AnimatedCurrentItemProperty);
            PlaylistItem item    = element.DataContext as PlaylistItem;

            if (curr != null && item != null && curr.UID == item.UID)
            {
                GradientStop stop1 = new GradientStop(Color1, -2d);
                GradientStop stop2 = new GradientStop(Color2, -1d);
                GradientStop stop3 = new GradientStop(Color1, 0d);
                GradientStop stop4 = new GradientStop(Color2, 1d);
                element.Background = new LinearGradientBrush(new GradientStopCollection(new List <GradientStop> {
                    stop1, stop2, stop3, stop4
                }));
                stop1.BeginAnimation(GradientStop.OffsetProperty, new DoubleAnimation(-2, 0, duration)
                {
                    RepeatBehavior = RepeatBehavior.Forever
                });
                stop2.BeginAnimation(GradientStop.OffsetProperty, new DoubleAnimation(-1, 1, duration)
                {
                    RepeatBehavior = RepeatBehavior.Forever
                });
                stop3.BeginAnimation(GradientStop.OffsetProperty, new DoubleAnimation(0, 2, duration)
                {
                    RepeatBehavior = RepeatBehavior.Forever
                });
                stop4.BeginAnimation(GradientStop.OffsetProperty, new DoubleAnimation(1, 3, duration)
                {
                    RepeatBehavior = RepeatBehavior.Forever
                });
            }
            else
            {
                element.Background = Brushes.Transparent;
            }
        }
Ejemplo n.º 10
0
        public ComboTextBlock()
        {
            _dependency = DependencyPropertyDescriptor.FromProperty(TextBlock.TagProperty, typeof(TextBlock));
            _dependency.AddValueChanged(this, (s, a) =>
            {
                if (s is TextBlock textBlock && textBlock.Tag is VirtualListItem item)
                {
                    if (string.IsNullOrEmpty(item.LeftText) && string.IsNullOrEmpty(item.ColorText) && string.IsNullOrEmpty(item.RightText))
                    {
                        textBlock.Inlines.Add(new Run(item.ToString()));
                    }

                    if (!string.IsNullOrEmpty(item.LeftText))
                    {
                        textBlock.Inlines.Add(new Run(item.LeftText));
                    }

                    if (!string.IsNullOrEmpty(item.ColorText))
                    {
                        textBlock.Inlines.Add(new Run(item.ColorText)
                        {
                            Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 119, 119))
                        });
                    }

                    if (!string.IsNullOrEmpty(item.RightText))
                    {
                        textBlock.Inlines.Add(new Run(item.RightText));
                    }

                    if (_animGradient != null)
                    {
                        _animGradient.BeginAnimation(GradientStop.OffsetProperty, null);
                        Background = new SolidColorBrush(Colors.White);
                    }
                }
            });
Ejemplo n.º 11
0
        public void refreshData()
        {
            if (lines.Count == 0)
            {
                return;
            }

            RaisePropertyChanged(() => valuecolor);
            RaisePropertyChanged(() => scale);
            RaisePropertyChanged(() => info);

            DoubleAnimation ani = new DoubleAnimation(scale, TimeSpan.FromSeconds(0.2), FillBehavior.HoldEnd);

            gstep1.BeginAnimation(GradientStop.OffsetProperty, ani);
            gstep2.BeginAnimation(GradientStop.OffsetProperty, ani);

            if (isShow)
            {
                foreach (line lin in lines)
                {
                    lin.refreshData();
                }
            }
        }
Ejemplo n.º 12
0
        public static void DrawingPolyline(Panel container, Polyline polyline)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            if (polyline == null)
            {
                throw new ArgumentNullException("polyline");
            }

            var animation = new DoubleAnimation
            {
                From         = 0,
                To           = 1,
                Duration     = new Duration(new TimeSpan(0, 0, 0, 0, 150)),
                FillBehavior = FillBehavior.HoldEnd
            };
            var strokeBrush     = new LinearGradientBrush();
            var blueStop        = new GradientStop(Colors.Blue, 0);
            var transparentStop = new GradientStop(Colors.Transparent, 0);

            strokeBrush.GradientStops.Add(new GradientStop(Colors.Blue, 0));
            strokeBrush.GradientStops.Add(blueStop);
            strokeBrush.GradientStops.Add(transparentStop);

            Storyboard.SetTarget(animation, transparentStop);
            Storyboard.SetTarget(animation, blueStop);
            Storyboard.SetTargetProperty(animation, new PropertyPath("Offset"));

            polyline.Stroke = strokeBrush;
            transparentStop.BeginAnimation(GradientStop.OffsetProperty, animation);
            blueStop.BeginAnimation(GradientStop.OffsetProperty, animation);
            container.Children.Add(polyline);
        }
Ejemplo n.º 13
0
        private void sunshine()
        {
            //Random rand = new Random(unchecked((int)DateTime.Now.Ticks));
            //for (int i = 0; i < 360; )
            //{
            //    Sunshine shine = new Sunshine();
            //    shine.rotate.Angle = i;
            //    viewconter.Children.Add(shine.viewport);
            //    i += rand.Next(10, 30);
            //}
            //for (int i = 0; i < 360; )
            //{
            //    Sunshine2D shine = new Sunshine2D();
            //    shine.rotate.Angle = i;
            //    shine.SnapsToDevicePixels = true;

            //    //shine.Width = 600;
            //    //shine.Height = 60;
            //    shine.Margin = new Thickness(945, 180, 0, 0);
            //    maincanvas.Children.Add(shine);
            //    i += rand.Next(5, 20);
            //}
            byte[] buffer  = Guid.NewGuid().ToByteArray();
            Int64  newguid = BitConverter.ToInt64(buffer, 0);
            int    intguid = int.Parse(newguid.ToString().Substring(0, 8));
            Random rand    = new Random(intguid);

            for (int i = 1; i < 24; i++)
            {
                Sunshine2D shine = new Sunshine2D();
                shine.set_sunshine(i);
                LinearGradientBrush grad  = new LinearGradientBrush();
                GradientStop        stop1 = new GradientStop();
                stop1.Offset = 0;
                stop1.Color  = Colors.White;
                GradientStop stop2 = new GradientStop();
                stop2.Offset = 1;
                stop2.Color  = Colors.Transparent;

                DoubleAnimation animation = new DoubleAnimation();
                animation.From           = 0;
                animation.To             = 2;
                animation.Duration       = TimeSpan.FromSeconds(10);
                animation.AutoReverse    = true;
                animation.RepeatBehavior = RepeatBehavior.Forever;
                animation.Duration       = TimeSpan.FromSeconds(rand.Next(3, 10));
                //animation.Duration = TimeSpan.FromSeconds(1);
                animation.From = ((double)rand.Next(0, 5) / 10d);



                switch (i)
                {
                case 1:
                    shine.Margin = new Thickness(945, 180, 0, 0);
                    break;

                case 2:
                    shine.Margin = new Thickness(945, 130, 0, 0);
                    break;

                case 3:
                    shine.Margin = new Thickness(945, 50, 0, 0);
                    break;

                case 4:
                    shine.Margin = new Thickness(945, -45, 0, 0);
                    break;

                case 5:
                    shine.Margin = new Thickness(945, -90, 0, 0);
                    break;

                case 6:
                    shine.Margin = new Thickness(945, -90, 0, 0);
                    break;

                case 7:
                    shine.Margin    = new Thickness(950, -110, 0, 0);
                    grad.StartPoint = new Point(0, 0.5);
                    grad.EndPoint   = new Point(1, 0.5);
                    break;

                case 8:
                    shine.Margin    = new Thickness(950, -280, 0, 0);
                    grad.StartPoint = new Point(0, 1);
                    grad.EndPoint   = new Point(1, 0.5);
                    break;

                case 9:
                    shine.Margin    = new Thickness(770, -230, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0);
                    break;

                case 10:
                    shine.Margin    = new Thickness(785, -90, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0);
                    break;

                case 11:
                    shine.Margin    = new Thickness(610, -95, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0);
                    break;

                case 12:
                    shine.Margin    = new Thickness(450, -110, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0);
                    break;

                case 13:
                    shine.Margin    = new Thickness(440, 55, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0);
                    break;

                case 14:
                    shine.Margin    = new Thickness(445, 125, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0.5);
                    break;

                case 15:
                    shine.Margin    = new Thickness(475, 165, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0.5);
                    break;

                case 16:
                    shine.Margin    = new Thickness(530, 170, 0, 0);
                    grad.StartPoint = new Point(1, 1);
                    grad.EndPoint   = new Point(0, 0.5);
                    break;

                case 17:
                    shine.Margin    = new Thickness(680, 160, 0, 0);
                    grad.StartPoint = new Point(1, 0);
                    grad.EndPoint   = new Point(0, 1);
                    break;

                case 18:
                    shine.Margin    = new Thickness(770, 170, 0, 0);
                    grad.StartPoint = new Point(1, 0);
                    grad.EndPoint   = new Point(1, 0.5);
                    break;

                case 19:
                    shine.Margin    = new Thickness(765, 170, 0, 0);
                    grad.StartPoint = new Point(1, 0);
                    grad.EndPoint   = new Point(1, 0.5);
                    break;

                case 20:
                    shine.Margin    = new Thickness(950, 170, 0, 0);
                    grad.StartPoint = new Point(0, 0);
                    grad.EndPoint   = new Point(1, 1);
                    break;

                case 21:
                    shine.Margin    = new Thickness(950, 170, 0, 0);
                    grad.StartPoint = new Point(0, 0);
                    grad.EndPoint   = new Point(1, 1);
                    break;

                case 22:
                    shine.Margin    = new Thickness(945, 170, 0, 0);
                    grad.StartPoint = new Point(0, 0);
                    grad.EndPoint   = new Point(1, 1);
                    break;

                case 23:
                    shine.Margin    = new Thickness(945, 170, 0, 0);
                    grad.StartPoint = new Point(0, 0);
                    grad.EndPoint   = new Point(1, 1);
                    break;

                case 24:
                    shine.Margin    = new Thickness(945, 170, 0, 0);
                    grad.StartPoint = new Point(0, 0);
                    grad.EndPoint   = new Point(1, 1);
                    break;
                }


                stop2.BeginAnimation(GradientStop.OffsetProperty, animation);

                grad.GradientStops.Add(stop1);
                grad.GradientStops.Add(stop2);
                shine.picturename.OpacityMask = grad;
                maincanvas.Children.Add(shine);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// The Player Controls Background rectangle animation aero to metro and metro to aero
        /// </summary>
        /// <returns></returns>
        public static RadialGradientBrush ControlBarBackground(bool aero)
        {
            RadialGradientBrush ln = new RadialGradientBrush();

            ln.Center         = new Point(0.5, 1);
            ln.RadiusX        = 0.8;
            ln.RadiusY        = 1;
            ln.GradientOrigin = new Point(0.5, 0.6);
            var TC = ((SolidColorBrush)App.Current.FindResource((aero) ? "PrimaryBrushCB" : "HighlightDarkColor")).Color;

            //Top Color
            GradientStop C1 = new GradientStop();

            C1.Color = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((!aero)?.75 : 1))
            };
            ln.GradientStops.Add(C1);

            //Middle Color
            GradientStop C2 = new GradientStop();

            C2.Color = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((!aero) ? .65 : 1))
            };
            C2.Offset = 0.378;
            ln.GradientStops.Add(C2);

            //Bottom Color
            GradientStop C3 = new GradientStop();

            C3.Color = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((!aero) ? 0 : 1))
            };
            C3.Offset = 1;
            ln.GradientStops.Add(C3);
            TC = ((SolidColorBrush)App.Current.FindResource((!aero) ? "PrimaryBrushCB" : "HighlightDarkColor")).Color;

            ColorAnimation ColorAnim3 = new ColorAnimation();

            ColorAnim3.To = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((aero) ? 0 : 1))
            };
            ColorAnim3.Duration       = TimeSpan.FromSeconds(.25);
            ColorAnim3.EasingFunction = new CircleEase()
            {
                EasingMode = EasingMode.EaseIn
            };
            C3.BeginAnimation(GradientStop.ColorProperty, ColorAnim3);

            ColorAnimation ColorAnim2 = new ColorAnimation();

            ColorAnim2.To = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((aero) ? .65 : 1))
            };
            ColorAnim2.Duration       = TimeSpan.FromSeconds(.25);
            ColorAnim2.EasingFunction = new CircleEase()
            {
                EasingMode = EasingMode.EaseOut
            };
            C2.BeginAnimation(GradientStop.ColorProperty, ColorAnim2);

            ColorAnimation ColorAnim1 = new ColorAnimation();

            ColorAnim1.To = new Color()
            {
                R = TC.R, G = TC.G, B = TC.B, A = (byte)(255 * ((aero)?.75 : 1))
            };
            ColorAnim1.Duration       = TimeSpan.FromSeconds(.25);
            ColorAnim1.EasingFunction = new CircleEase()
            {
                EasingMode = EasingMode.EaseOut
            };
            C1.BeginAnimation(GradientStop.ColorProperty, ColorAnim1);

            return(ln);
        }