在Windows Phone应用程序的登录页面上使用进度条

时间:2013-06-20 10:28:06

标签: c# windows visual-studio windows-phone-7

我正在使用visual studio 2012 ultimate开发windows phone应用程序。 我的应用程序中有一个页面,其中有一个提交按钮。 我想在点击提交按钮时使用进度条,它将显示,直到下一页被加载。我已经将工具箱中的进度条控件添加到我的设计文件中但是现在但接下来要做什么?那么请任何人帮助我...... 在此先感谢.....

2 个答案:

答案 0 :(得分:0)

如果您使用的是Indeterminate ProgressBar(带有点在屏幕上流动的那个),则当您想要显示它时,将其Visibility属性从Collapsed更改为Visible。当你想隐藏它时,将它改回Collapsed。

<ProgressBar x:Name="playerProgressBar" IsIndeterminate="True" Height="22"  Margin="0"   Visibility="Collapsed" Width="478" Style="{StaticResource ProgressBarStyle1}" />

如果是正常进度条,则只需将其Value属性设置为您要显示的百分比进度。您可以将Value属性绑定到页面中的成员变量。

<ProgressBar x:Name="playerShowProgress" Height="12" VerticalAlignment="Top" Value="{Binding Path=ShowProgressBarValue, Mode=OneWay}" Width="321" Visibility="Visible" Style="{StaticResource ProgressBarStyle1}" />

答案 1 :(得分:0)

<强> PerformanceProgressBar

对于Windows Phone 7,由于内置PerformanceProgressBar

的长期性能问题,建议您使用WP Toolkit中的ProgressBar
<toolkit:PerformanceProgressBar IsIndeterminate="True"></toolkit:PerformanceProgressBar>

IsIndeterminate用于打开和关闭控件。如果将Visibility设置为Visibility.Collapsed,则控件仍在运行并使用CPU时间,这是不好的。

SystemTray + ProgressBar

Windows Phone 7.1(7.5或Mango)中引入的另一个选项是将ProgressBar添加到SystemTray(内置本机应用程序使用此技术),以下链接应该是有用的...

http://www.jeff.wilcox.name/2011/07/creating-a-global-progressindicator-experience-using-the-windows-phone-7-1-sdk-beta-2/

http://blog.duc.as/2011/10/08/using-the-system-tray-to-show-progress-in-windows-phone-7-mango/

http://xamlgeek.net/2012/10/30/using-the-progressindicator-in-the-systemtray-in-windows-phone/