/// <summary> /// Fires the <see cref="PropertyChanged"/> event. /// </summary> /// <param name="name">Name of the property which changed.</param> protected virtual void DoPropertyChanged(string name) { // Do nothing when disposed if (IsDisposed) { return; } // Run event handler on UI thread if (PropertyChanged != null) { UIThread.StartNew(() => { // Do nothing when disposed (may occur whilst scheduling call to UI thread) if (IsDisposed) { return; } // Fire event causing UI to update PropertyChanged(this, new PropertyChangedEventArgs(name)); }) .Wait(UpdateTimeout); } }
/// <summary> /// Fires the <see cref="PropertyChanged"/> event. /// </summary> /// <param name="name">Name of the property which changed.</param> protected virtual void DoPropertyChanged(string name) { if (PropertyChanged != null) { UIThread.StartNew(() => { PropertyChanged(this, new PropertyChangedEventArgs(name)); } ).Wait(); } }