Windows phone 7 如何在windows phone中显示加载阻止程序视图?

Windows phone 7 如何在windows phone中显示加载阻止程序视图?,windows-phone-7,windows-phone-8,progress-bar,Windows Phone 7,Windows Phone 8,Progress Bar,我想在任何HTTP请求进入服务器或执行任何异步操作时显示loading blocker视图 主要目标是,有时我们希望在操作完成之前停止最终用户与应用程序UI的交互 在Android世界中,我会调用ProgressDialog,这会导致 屏幕变暗和特定于手机的微调器动画等等 消息我想要在屏幕中间。 我知道在windows phone中,我们可以选择在系统托盘中指示进程 ProgressIndicator progress = new ProgressIndicator

我想在任何HTTP请求进入服务器或执行任何异步操作时显示loading blocker视图

主要目标是,有时我们希望在操作完成之前停止最终用户与应用程序UI的交互

在Android世界中,我会调用ProgressDialog,这会导致 屏幕变暗和特定于手机的微调器动画等等 消息我想要在屏幕中间。

我知道在windows phone中,我们可以选择在系统托盘中指示进程

            ProgressIndicator progress = new ProgressIndicator
            {
                IsVisible = true,
                IsIndeterminate = true,
                Text = "Connecting to server..." //TODO:Locale
            };
            SystemTray.SetProgressIndicator(this, progress);
但是,我想通过在视图中添加视图和我自己的加载程序动画来阻止UI交互

我们可以从整个应用程序调用相同的视图吗


谢谢。

您可以使用覆盖所有页面的网格,并通过属性控制其可见性

<Grid  Visibility="{Binding Path=YourGrid.LoadingVisibility,Source={StaticResource Locator}, UpdateSourceTrigger=Default,Mode=TwoWay}"   x:Name="OverlayGrid" Grid.Row="0" Background="Transparent" Grid.Column="0" Grid.RowSpan="11" Grid.ColumnSpan="3" Style="{StaticResource PortraitGridStyle}">

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Border Background="White" Opacity="0.4"></Border>
        <ProgressBar IsIndeterminate="True" HorizontalAlignment="Center" Foreground="Black"  VerticalAlignment="Center" Width="400" Height="10" />
    </Grid>


此示例具有Windows phone中的默认动画,其中使用progressbar控件浮动5个点

感谢您的回复-我正在使用进度覆盖。这对我来说很好。谢谢你分享这个链接,将来会有帮助的