निम्नलिखित कोड ठीक Silverlight में काम करता है:WinRT/मेट्रो एनीमेशन में कोड-पीछे
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(doubleAnimation, button1);
Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("Width"));
storyboard.Begin();
}
WinRT/मेट्रो में यह एक मामूली परिवर्तन की जरूरत है यह संकलन करने के लिए:
Storyboard.SetTargetProperty(doubleAnimation, "Width");
लेकिन जब आप इसे चलाओ, कुछ भी नहीं होता है।
आप "चौड़ाई" से संपत्ति को बदलते हैं "अस्पष्टता" (यह भी = 0 और करने के लिए = 1 से बदलने) के लिए है कि काम करता है।
"चौड़ाई" के साथ समस्या क्या है?
क्यों आप 'EventTrigger' http://msdn.microsoft.com/en-us/library/system.windows.eventtrigger.aspx XAML को यह सब कोड बढ़ने के लिए नहीं इस्तेमाल किया है? – RredCat
@RredCat - जहां तक मुझे पता है कि हमारे पास WinRT में EventTrigger नहीं है। –