Beispiel #1
0
        /// <summary>
        /// Updates the <see cref="SiteMarker"/> to reflect the current <see cref="ViewOptions"/>.
        /// </summary>
        /// <remarks>
        /// <b>UpdateMarker</b> enables or disables color animation for the <see
        /// cref="SiteMarker"/>, depending on the current <see cref="ViewOptions"/>.</remarks>

        public void UpdateMarker()
        {
            if (ApplicationOptions.Instance.View.StaticMarker)
            {
                this._siteMarker.Stroke = Brushes.White;
            }
            else
            {
                // animation to cycle between colors
                var animation = new DoubleAnimation(0.3, 0.6, Duration.Automatic);
                animation.AutoReverse    = true;
                animation.RepeatBehavior = RepeatBehavior.Forever;

                // radial brush with animated color spectrum
                var brush = new RadialGradientBrush(Colors.Yellow, Colors.White);
                brush.SpreadMethod = GradientSpreadMethod.Reflect;
                brush.BeginAnimation(RadialGradientBrush.RadiusXProperty, animation);
                brush.BeginAnimation(RadialGradientBrush.RadiusYProperty, animation);

                this._siteMarker.Stroke = brush;
            }
        }