我正在使用visual studio 2012 ultimate开发windows phone应用程序。 我的应用程序中有一个页面,其中有一个提交按钮。 我想在点击提交按钮时使用进度条,它将显示,直到下一页被加载。我已经将工具箱中的进度条控件添加到我的设计文件中但是现在但接下来要做什么?那么请任何人帮助我...... 在此先感谢.....
答案 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
ProgressBar
<toolkit:PerformanceProgressBar IsIndeterminate="True"></toolkit:PerformanceProgressBar>
IsIndeterminate
用于打开和关闭控件。如果将Visibility
设置为Visibility.Collapsed
,则控件仍在运行并使用CPU时间,这是不好的。
SystemTray + ProgressBar
Windows Phone 7.1(7.5或Mango)中引入的另一个选项是将ProgressBar
添加到SystemTray
(内置本机应用程序使用此技术),以下链接应该是有用的...
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/