private void NotifyPropertyChanged(string propertyName){ PropertyChangedEventHandler cb_copy = null; lock(sync){ if(cb!=null){ cb_copy = cb.Clone() as PropertyChangedEventHandler; } } if (cb_copy != null) { cb_copy(this, new PropertyChangedEventArgs(propertyName)); } }
private void OnPropertyChanged(string property) { //Send notification without acquiring the synchro object PropertyChangedEventHandler localCopy; lock (synchro) { localCopy = internalPropertyChanged != null ? (PropertyChangedEventHandler)internalPropertyChanged.Clone() : null; } if (localCopy != null) { localCopy(this, new PropertyChangedEventArgs(property)); } }