繁体   English   中英

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

[英]Use progressbar on login page of windows phone application

我正在使用Visual Studio 2012 Ultimate开发Windows Phone应用程序。 我的应用程序中有一页,其中有一个提交按钮。 我想在单击“提交”按钮时使用进度条,它会一直显示到下一页被加载。我已经在设计文件中从工具箱中添加了进度条控件,但是现在该怎么做? 因此,请任何人帮助我。

如果您使用的是Indeterminate ProgressBar(一个在整个屏幕上都有点流动的点),则在要显示它时,将其“可见性”属性从“折叠”更改为“可见”。 要隐藏它时,将其更改回“已折叠”。

<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}" />

PerformanceProgressBar

对于Windows Phone 7,由于内置的ProgressBar长期存在性能问题,建议您使用WP Toolkit中的 PerformanceProgressBar

<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/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM