アニメーションに関連する 2 つの問題があります。
1) 次のコードはタイトルとボーダーをアニメーション化しません。私は this.FadeIn() のように次のように呼び出しています。これはもちろん UIElement 型です。
public static void FadeIn(this UIElement targetControl)
{
DoubleAnimation fadeInAnimation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(1.5)));
Storyboard.SetTarget(fadeInAnimation, targetControl);
Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty));
Storyboard sb = new Storyboard();
sb.Children.Add(fadeInAnimation);
sb.Begin();
}
2) これも機能せず、アニメーションが表示されません。
public static void SkewAnimation(this UIElement targetControl)
{
DoubleAnimation skewAnimation = new DoubleAnimation(0, 360, new Duration(TimeSpan.FromSeconds(3)));
Storyboard.SetTarget(skewAnimation, targetControl);
Storyboard.SetTargetProperty(skewAnimation, new PropertyPath(SkewTransform.AngleXProperty));
Storyboard sb = new Storyboard();
sb.Children.Add(skewAnimation);
sb.Begin();
}