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;