adding IsDispatching to INotifyPropertyChangedEx

Topics: Feature Requests
Dec 9, 2011 at 6:37 PM

I have run into a performance bottleneck in which I'm attempting to initialize a large graph of objects that derive from PropertyChangedBase. It seems a lot of time is being spent dispatching property change notifications which is not necessary at initialization time. I need the property notifications, and after initialization is finished, I need the dispatching. So it might be nice to have a IsDispatching property to control this.

Dec 9, 2011 at 8:36 PM

I believe INotifyPropertyChangedEx has an IsNotifying property which, when set to false, disables all notifications for the time being

Dec 9, 2011 at 9:41 PM

Yes, but I need the notifications to be enabled. And I need them to happen without dispatching to UI thread...

public virtual void NotifyOfPropertyChange(string propertyName) {
    if(IsNotifying) {
        if (IsDispatching)
            Execute.OnUIThread(() => RaisePropertyChangedEventCore(propertyName));