0

我有一个 ItemsPage。当用户导航时,应用程序会下载一些图像。我想在每个人身上看到 ProgressRing。

我的 GridView 模板

<GridView.ItemTemplate>
  <DataTemplate>
    <Grid HorizontalAlignment="Left"
          Width="150"
          Height="230">
      <Canvas>
        <ProgressRing x:Name="imageProgress"
                      Canvas.ZIndex="10"
                      Width="100"
                      Height="100"
                      HorizontalAlignment="Left"
                      Grid.Column="0" />
        <Image x:Name="FilmImage"
               Source="{Binding Image}"
               Stretch="UniformToFill"
               AutomationProperties.Name="{Binding Title}" />
      </Canvas>
      <StackPanel VerticalAlignment="Bottom"
                  Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
        <TextBlock Text="{Binding Title}"
                   Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}"
                   Style="{StaticResource TitleTextStyle}"
                   Height="60"
                   Margin="15,0,15,0" />
        <TextBlock Text="{Binding Subtitle}"
                   Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}"
                   Style="{StaticResource CaptionTextStyle}"
                   TextWrapping="NoWrap"
                   Margin="15,0,15,10" />
      </StackPanel>
    </Grid>
  </DataTemplate>
</GridView.ItemTemplate>

我的.cs

 public sealed partial class AllCinemas : LayoutAwarePage
    {
protected async override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
        {

            FeedAllCinemas allCinemas = new FeedAllCinemas();
            allCinemas.GetAllCinemas("", "");
            this.DefaultViewModel["Items"] = allCinemas.Cinemas;
        }
}
4

2 回答 2

3

请查看这篇很棒的博客文章,这正是您想要的:Windows 8(或通常是 XAML):加载带有进度/回退内容的图像

在此处输入图像描述

于 2013-04-19T05:11:12.600 回答
1

请检查这个线程,它包含一个解决方案:http ://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/536a3d52-0c9f-4875-8ad5-991a9eab17c8/

于 2013-04-19T01:43:53.170 回答