Well I have two problems both related to animation.
1) The following code does not animate the tittle and border i am calling the following like this.FadeIn(), this being of type UIElement of course.
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) This is also not working, no animation is shown.
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();
}
Why not simply animate like this:
and, provided that the element’s
RenderTransformproperty is set to a SkewTransform:EDIT: This would require something like
or in XAML:
Not sure why your FadeIn won’t work, but your SkewAnimation can’t work due to the property path.
SkewTransform.AngleXPropertyis not defined for UIElement. The property path would have to be something like this (again provided that RenderTransform was set to SkewTransform):