Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight 在Windows Phone中设置按钮位置动画_Silverlight_Animation_Windows Phone 8 - Fatal编程技术网

Silverlight 在Windows Phone中设置按钮位置动画

Silverlight 在Windows Phone中设置按钮位置动画,silverlight,animation,windows-phone-8,Silverlight,Animation,Windows Phone 8,我有一个Windows Phone应用程序,它有两个按钮。我的应用程序的总体布局如下所示: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="60" /> <ColumnDefinition /> <ColumnDefinition Width="60" /> </Grid.ColumnDefinitions> <Gr

我有一个Windows Phone应用程序,它有两个按钮。我的应用程序的总体布局如下所示:

<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="60" />
    <ColumnDefinition />
    <ColumnDefinition Width="60" />
  </Grid.ColumnDefinitions>

  <Grid x:Name="captionGrid" VerticalAlignment="Bottom" Grid.Column="1" Background="Transparent">                                
    <Border Background="#3D3D3D" Opacity="0.4" />
    <TextBlock Text="[Some Text Goes Here]" Foreground="White" TextWrapping="Wrap" />
  </Grid>

  <Button x:Name="previousButton" Click="previousButton_Click">
    <Button.Template>
      <ControlTemplate>
        <Grid Background="Transparent">
          <Border Background="#3D3D3D" Opacity="0.4" />
          <TextBlock Text="Prev." VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" />
        </Grid>
      </ControlTemplate>
    </Button.Template>
  </Button>

  <Button x:Name="nextButton" Grid.Column="2" Click="nextButton_Click">
    <Button.Template>
      <ControlTemplate>
        <Grid>
          <Border Background="#3D3D3D" Opacity="0.4" />
          <TextBlock Text="Next" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" />
        </Grid>
      </ControlTemplate>
    </Button.Template>
  </Button>
</Grid>

当用户单击屏幕上的按钮时,我想运行一个故事板。故事板需要做三件事:1)向左滑动Prev按钮,使其不在视图中。2) 将“下一步”按钮向右滑动,使其不在视图中。3)向下滑动标题栏,使其不在视野内。不过,我似乎无法为这三个元素的位置设置动画。边距是一个厚度,因此Silverlight不直接支持它。如果我使用画布作为背景元素,则并非所有内容都适合屏幕的宽度/高度

有人知道我如何解决这个问题吗?如果是,怎么做


谢谢

您可以使用RenderTransform属性设置动画。请参见:,标题为“设置变换动画”的部分