에서 다음 코드는 실버 라이트에서 잘 작동 :WinRT가/메트로 애니메이션 코드 숨김
가 하나의 작은 변화를 필요로 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();
}
가 컴파일 할 :
Storyboard.SetTargetProperty(doubleAnimation, "Width");
을하지만 때를 그것을 실행, 아무 일도 일어나지 않습니다.
속성을 "너비"에서 "불투명도"(변경 가능 : 0 및 종료 = 1)로 변경하면 작동합니다.
"너비"의 문제점은 무엇입니까?
왜이 코드를 xaml로 옮기려면 http://msdn.microsoft.com/en-us/library/system.windows.eventtrigger.aspx의 'EventTrigger'를 사용하지 않았습니까? – RredCat
@RredCat - 내가 아는 한 WinRT에는 EventTrigger가 없습니다. –