Example #1
0
        /// <summary> Creates and starts a proper ColorAnimation when the color changes for Player 2.  </summary>
        /// <param name="player"> The player. </param>
        private void Player2ColorChanged(Player player)
        {
            var converter = new PlayerColorConverter();
            var color     = (Color)converter.Convert(player.Color, typeof(Color), null, null);
            var anim      = new ColorAnimation(color, new TimeSpan(0, 0, 0, 0, 500));

            player2Color.BeginAnimation(GradientStop.ColorProperty, anim);
        }
Example #2
0
        private void Player1ColorChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var converter = new PlayerColorConverter();
            var color     = (Color)converter.Convert(e.NewValue, typeof(Color), null, null);
            var anim      = new ColorAnimation(color, new TimeSpan(0, 0, 0, 0, 500));

            player1Color.BeginAnimation(GradientStop.ColorProperty, anim);
        }
 /// <summary> Creates and starts a proper ColorAnimation when the color changes for Player 2. </summary>
 /// <param name="player"> The player.  </param>
 private void Player2ColorChanged(Player player)
 {
     var converter = new PlayerColorConverter();
     var color = (Color)converter.Convert(player.Color, typeof(Color), null, null);
     var anim = new ColorAnimation(color, new TimeSpan(0, 0, 0, 0, 500));
     this.player2Color.BeginAnimation(GradientStop.ColorProperty, anim);
 }
 private void Player2ColorChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     var converter = new PlayerColorConverter();
     var color = (Color)converter.Convert(e.NewValue, typeof(Color), null, null);
     var anim = new ColorAnimation(color, new TimeSpan(0, 0, 0, 0, 500));
     player2Color.BeginAnimation(GradientStop.ColorProperty, anim);
 }