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.
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
RenderTransform works fine.