如何定义 XAML 以无限旋转矩形?
到目前为止,我找到了一个带有代码但没有 xaml 的解决方案:http: //www.codeproject.com/Articles/23257/Beginner-s-WPF-Animation-Tutorial 我这样使用:
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
var doubleAnimation = new DoubleAnimation(360, 0, new Duration(TimeSpan.FromSeconds(1)));
var rotateTransform = new RotateTransform();
rect1.RenderTransform = rotateTransform;
rect1.RenderTransformOrigin = new Point(0.5, 0.5);
doubleAnimation.RepeatBehavior = RepeatBehavior.Forever;
rotateTransform.BeginAnimation(RotateTransform.AngleProperty, doubleAnimation);
}
但是我怎样才能只用 XAML 来实现呢?