Bladewise,
Thanks for the reply. That's what I thought and I previously tried something very similar to what you posted. Based on your code, I've implemented the following
Regards
Alan
Thanks for the reply. That's what I thought and I previously tried something very similar to what you posted. Based on your code, I've implemented the following
private bool isBusy = false;
public bool IsBusy
{
get { return isBusy; }
set
{
if (isBusy != value) {
isBusy = value;
NotifyOfPropertyChange(() => IsBusy);
NotifyOfPropertyChange(() => CanRequestData);
}
}
}
public bool CanRequestData
{
get
{
return !IsBusy && AccountViewModel.Accounts.Count > 0;
}
}
public void RequestData()
{
if (!IsBusy) {
try {
IsBusy = true;
... // Perform the action ...
}
finally {
IsBusy = false;
}
}
}
This doesn't seem to disable the button whilst the action is taking place and the clicks are simply queued up. Do I need to use RaisePropertyChanged, because I couldn't find this method on my VM which is inheriting from Screen.Regards
Alan