Click here to Skip to main content
15,881,764 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i want to create a skew transformation in WPF programatically so that window flip when open. i have create a fadein animation using the following code

C#
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();
        }


an i wanted to make a skew method same as above and also in above the tittle and the border is not animated when i call this function

like this

C#
public partial class childWindow1 : Window
    {
        public childWindow1()
        {
            InitializeComponent();

            this.FadeIn();


        }
Posted
Updated 9-Aug-12 3:27am
v2
Comments
Kenneth Haugland 9-Aug-12 9:58am    
Have you looked in the class of RenderTransfor, there sould be something called rotate transform, and scale trasform etc...
agha_ali22 9-Aug-12 11:49am    
public static void SkewAnimation(this UIElement targetControl)
{
DoubleAnimation skewAnimationX = new DoubleAnimation(0, 360, new Duration(TimeSpan.FromSeconds(3)));


Storyboard.SetTarget(skewAnimationX, targetControl);


Storyboard.SetTargetProperty(skewAnimationX, new PropertyPath(SkewTransform.AngleXProperty));

Storyboard sb = new Storyboard();
sb.Children.Add(skewAnimationX);

sb.Begin();
}

this is not working either .any idea what is the problem

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900