Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2589
Applying ScaleTransform to control
posted

Hello,

I'm trying to animate control appearance from screen center to edges and I try to use ScaleTransform for this. But when I run this storyboard

<Storyboard x:Key="sbMaximize">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="TreeMap">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.500" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="TreeMap">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.500" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

It scales only text inside the control but not the control itself. Control remains stretched all the time. What should I do?

Thank you.

Parents
No Data
Reply
  • 30945
    Verified Answer
    Offline posted

    Hello Dmitry,

     

    I have been looking into your issue and  when you use LayoutTransform property it renders the components based on their set sizes, because the LayoutTransform does its transformation based on the layout the control is in.. When the width and the height of a control are not set initially their values are set to NaN and scale cannot affect it.

     

    What you can do is either make sure that your Height and Width are set or use a RenderTransfrom which does not regenerate layout size or render size information but rather  does its transformations based on the controls rendered visual element.

     

    Please let me know if this is what you needed and if you require any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support

Children