如何無限旋轉矩形 - 僅在xaml定義中。到目前爲止,我發現代碼中的解決方案,但沒有XAML: http://www.codeproject.com/Articles/23257/Beginner-s-WPF-Animation-Tutorial 我用這樣的:WPF在XAML中旋轉矩形動畫
private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
var da = new DoubleAnimation(360, 0, new Duration(TimeSpan.FromSeconds(1)));
var rt = new RotateTransform();
rect1.RenderTransform = rt;
rect1.RenderTransformOrigin = new Point(0.5, 0.5);
da.RepeatBehavior = RepeatBehavior.Forever;
rt.BeginAnimation(RotateTransform.AngleProperty, da);
}
但我怎麼能只用XAML實現這一目標?
http://www.galasoft.ch/mydotnet/articles/article-2006102701.aspx這解釋了代碼隱藏和XAML版本.. http://www.google.com! – KyorCode
它看起來我在找什麼,我會檢查。謝謝。 –
你的問題的代碼是我的問題的答案。謝謝! –