弹力网格儿童元素故事板规模wp8

时间:2014-09-17 08:12:40

标签: windows-phone-8 storyboard

在故事板动画后拉伸子网格元素。如何停止拉伸Grid子元素 这是故事板代码

  <Storyboard x:Name="Storyboard_FullScreenSensor">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="GridM">
            <EasingDoubleKeyFrame KeyTime="0" Value="1.088"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1.417"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="GridM">
            <EasingDoubleKeyFrame KeyTime="0" Value="-3"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-15"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

和包含许多视图项的GridM代码,例如按钮,图像

 <Grid 
        x:Name="GridM" 
        Height="340" Margin="0,85,0,0"
  RenderTransformOrigin="0.5,0.5">
        <Grid.RenderTransform>
            <CompositeTransform/>
        </Grid.RenderTransform>

        <Grid 
        Name="GridLoader"
        >
// code
        </Grid>

        <ContentControl 
            x:Name="" 
            >
            //code

        </ContentControl>

        <Grid
            Name="GridChild"
/>
</Grid>

在故事板的动画之后拉伸媒体网格中的所有孩子 显示为 enter image description here

必填视图为

1 个答案:

答案 0 :(得分:0)

在故事板中,如果使用伸展该网格的Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)"。用

解决
 <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Width)" Storyboard.TargetName="GridM">
            <EasingDoubleKeyFrame KeyTime="0" Value="480"/>
            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="800"/>
        </DoubleAnimationUsingKeyFrames>

 <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Height)" Storyboard.TargetName="GridM">
            <EasingDoubleKeyFrame KeyTime="0" Value="340"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="480"/>
        </DoubleAnimationUsingKeyFrames>

启动storyboard.Begin()

时,它会调整特定组件的宽度或高度