Windows Phone 8.1 PointerReleased 点击截屏

network | | 访问(48)
<Grid x:Name="root" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
          PointerReleased="Grid_PointerReleased">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,35,0,28">
        <TextBlock Text="我的应用程序" FontSize="20"  />
        <TextBlock Text="点击截屏" FontSize="60" />
    </StackPanel>
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" >
        <Image x:Name="img" />
    </Grid>
</Grid>
private async void Grid_PointerReleased(object sender, PointerRoutedEventArgs e) {
    RenderTargetBitmap bitmap = new RenderTargetBitmap();
    await bitmap.RenderAsync(root);
    img.Source = bitmap;
}