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;

posted on 2011-04-08 18:06  SUNJUNLIN  阅读(1462)  评论(0编辑  收藏  举报

导航