MVMM 中的ViewModel 实现IsLoading进度条
private bool _isBusy = false;
public bool IsBusy
{
get
{
return _isBusy;
}
internal set
{
_isBusy = value;
base.RaisePropertyChanged("IsBusy");
}
}
注意:在这里必须设定 internal set才可以。。测试可行
XMAL:
<my:BusyIndicator x:Name="busyindicator" IsBusy="{Binding IsBusy}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
开始loading的时候,代码要在构造方法中
public VMInfoViewModel()
{
if (!DesignerProperties.IsInDesignTool)
{
this.IsBusy = true;
结束loading的时候
private void loadOperation_Completed(object sender, EventArgs e)
{
this.IsBusy = false;
作者:johnny
出处:http://www.cnblogs.com/sunjunlin
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
posted on 2011-04-08 18:06 SUNJUNLIN 阅读(1462) 评论(0) 编辑 收藏 举报