2013-10-10 27 views
1

請告訴我如何在iOS 8中執行windows phone 8中的動畫。如何在Windows Phone 8中執行動畫

我的意思是
[UIView animateWithDuration:0.2 animtaion:{} completion:{}];

類似的功能,是否有可能不設定目標和其他屬性與故事板和DoubleAnimation(或像這樣)來實現這一點?

現在我在做這樣的:

 DoubleAnimation myDoubleAnimation = new DoubleAnimation(); 
     myDoubleAnimation.From = 10; 
     myDoubleAnimation.To = 50; 
     myDoubleAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(200)); 

     // Configure the animation to target the button's Width property. 
     Storyboard.SetTarget(myDoubleAnimation, selectedItem); 
     Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(ListBoxItem.HeightProperty)); 

     // Create a storyboard to contain the animation. 
     Storyboard myHeightAnimatedButtonStoryboard = new Storyboard(); 
     myHeightAnimatedButtonStoryboard.Children.Add(myDoubleAnimation); 
     myHeightAnimatedButtonStoryboard.Begin(); 

我希望你明白我需要什麼:) 謝謝;

+0

在XAML中它會更短...您只是尋找更短/更好的符號?你多久使用一次,以什麼方式使用? –

回答

1

故事板在UI元素上運行,因此它必須設置一個目標元素以查看動畫效果,並且按照設置其他屬性的方式,我建議使用相同的表達式混合。它是一個奇妙的工具。