// EventRegistrationToken PropertyChanged.add(PropertyChangedEventHandler value) internal EventRegistrationToken add_PropertyChanged(PropertyChangedEventHandler value) { INotifyPropertyChanged _this = Unsafe.As<INotifyPropertyChanged>(this); EventRegistrationTokenTable<PropertyChangedEventHandler> table = s_weakTable.GetOrCreateValue(_this); EventRegistrationToken token = table.AddEventHandler(value); _this.PropertyChanged += value; return token; }
internal EventRegistrationToken add_CollectionChanged(NotifyCollectionChangedEventHandler value) { INotifyCollectionChanged _this = JitHelpers.UnsafeCast <INotifyCollectionChanged>(this); EventRegistrationTokenTable <NotifyCollectionChangedEventHandler> table = m_weakTable.GetOrCreateValue(_this); EventRegistrationToken token = table.AddEventHandler(value); _this.CollectionChanged += value; return(token); }
// EventRegistrationToken PropertyChanged.add(EventHandler<object> value) private EventRegistrationToken add_CanExecuteChanged(EventHandler<object> value) { ICommand _this = Unsafe.As<ICommand>(this); EventRegistrationTokenTable<EventHandler> table = s_weakTable.GetOrCreateValue(_this); EventHandler handler = ICommandAdapterHelpers.CreateWrapperHandler(value); EventRegistrationToken token = table.AddEventHandler(handler); _this.CanExecuteChanged += handler; return token; }