WinRT/Metro Animation in code-behind
问题 The following code works fine in Silverlight: private void Button_Click_1(object sender, RoutedEventArgs e) { Storyboard storyboard = new Storyboard(); DoubleAnimation doubleAnimation = new DoubleAnimation(); doubleAnimation.From = 50; doubleAnimation.To = 100; doubleAnimation.RepeatBehavior = RepeatBehavior.Forever; doubleAnimation.AutoReverse = true; doubleAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(200)); storyboard.Children.Add(doubleAnimation); Storyboard.SetTarget