Windows phone 显示进度条

Windows phone 显示进度条,windows-phone,progress-bar,Windows Phone,Progress Bar,我的主页中有一个图像控件,代码如下: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <StackPanel HorizontalAlignment="Left" Height="597" VerticalAlignment="Top" Width="440"> <Image x:Name="hinh1" Height="488" Stretch="Fill"/>

我的主页中有一个图像控件,代码如下:

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <StackPanel HorizontalAlignment="Left" Height="597" VerticalAlignment="Top" Width="440">
        <Image x:Name="hinh1" Height="488" Stretch="Fill"/>
        <ProgressBar Name="loading" Height="10" IsIndeterminate="True" Visibility="Collapsed"/>
    </StackPanel>
</Grid>

在等待图像加载时,我想调用进度条run来通知用户它正在加载。加载图像后,进度条应消失。我怎样才能做到这一点呢?

如果我是你,我宁愿使用ProgressBar,而不是ProgressBar

所以,我给你

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    loading.IsActive = true;
    Uri hinh = new Uri
    ("http://taigamejar.net/wp-content/uploads/2014/01/Hinh-Anh-Dep-5.jpg", UriKind.Absolute);
    hinh1.Source = new BitmapImage(hinh);

    hinh1.ImageOpened+=hinh1_ImageOpened; //loadingbar will be disappear when this triggered
}

private void hinh1_ImageOpened(object sender, RoutedEventArgs e)
{
    loading.IsActive = false; //this will disable the progressring.
}
和XAML:

    <StackPanel HorizontalAlignment="Left" Height="597" VerticalAlignment="Top" Width="400">
        <Image x:Name="hinh1" Height="488" Stretch="Fill" ImageOpened="hinh1_ImageOpened"/>
        <ProgressRing Name="loading" Height="109" IsActive="True"  />
    </StackPanel>


如果您还没有WP8.1 SDK,您可以在这里获得进展:

非常感谢您在Tirpan上的帮助。我会尽力回复结果。再次感谢一张这只是一张图片。有多少张照片
    <StackPanel HorizontalAlignment="Left" Height="597" VerticalAlignment="Top" Width="400">
        <Image x:Name="hinh1" Height="488" Stretch="Fill" ImageOpened="hinh1_ImageOpened"/>
        <ProgressRing Name="loading" Height="109" IsActive="True"  />
    </StackPanel>