I have this property in my view model.
public bool IsKWH { get { return _isKwh; } set { if (value.Equals(_isKwh)) return; _isKwh = value; NotifyOfPropertyChange(() => IsKWH); } }
Sometimes (~ 1 10 times), when I close my application, I get the following error in NotifyOfPropertyChange:
An exception like "System.Threading.Tasks.TaskCanceledException" occurred in WindowsBase.dll but was not handled in the user code
Additional Information: The task has been canceled.
I have System.Threading.Timer in my view model, which calls a webservice call to update this and many other properties.
I am using Caliburn.Micro and it looks like it started to happen when I upgraded from 1.5 to 2.0.
In any case, so that this error does not occur?
source share