示例#1
0
			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));
				}
			}
示例#2
0
        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));
            }
        }