or
private
bool
_isBusy;
public
bool
IsBusy
{
get
{
return
_isBusy; }
set
{
if
(_isBusy == value)
return
;
_isBusy = value;
OnPropertyChanged();
}
}
var backgroundWorker =
new
BackgroundWorker();
backgroundWorker.DoWork +=
delegate
{
IsBusy =
true
;
DoHeavyWork();
};
backgroundWorker.RunWorkerCompleted +=
delegate
{
IsBusy =
false
;
};
backgroundWorker.RunWorkerAsync();