ViewModel 视图模型

 

public abstract class ViewModelBase : INotifyPropertyChanged
{
    private bool isbusy;

    public bool IsBusy
    {
        get
        {
            return isbusy;
        }
        set
        {
            isbusy = value;
            RaisePropertyChanged("IsBusy");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected void RaisePropertyChanged(string propertyName)
    {
        PropertyChangedEventHandler handler = PropertyChanged;

        if (handler != null)
        {
            handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

 

 

View 视图

 

<extWpfTk:BusyIndicator IsBusy="{Binding IsBusy}">
        <ContentControl />
    </extWpfTk:BusyIndicator>

 

IsBusy = true 时,  BusyIndicator 就开始显示出来

 

 参考网址 http://stackoverflow.com/questions/12384012/busyindicator-using-mvvm

Extended WPF Toolkit 下载地址 http://wpftoolkit.codeplex.com/releases/view/99072

 

 

 

 

 

相关文章:

  • 2021-08-20
  • 2021-06-09
  • 2021-09-27
  • 2022-02-18
猜你喜欢
  • 2022-12-23
  • 2021-10-12
  • 2022-03-07
  • 2021-04-14
相关资源
相似解决方案