internal void remove_PropertyChanged(EventRegistrationToken token) { INotifyPropertyChanged _this = JitHelpers.UnsafeCast <INotifyPropertyChanged>(this); EventRegistrationTokenTable <PropertyChangedEventHandler> table = m_weakTable.GetOrCreateValue(_this); PropertyChangedEventHandler handler = table.ExtractHandler(token); if (handler != null) { _this.PropertyChanged -= handler; } }
// void PropertyChanged.remove(EventRegistrationToken token) private void remove_CanExecuteChanged(EventRegistrationToken token) { ICommand _this = JitHelpers.UnsafeCast <ICommand>(this); EventRegistrationTokenTable <EventHandler> table = m_weakTable.GetOrCreateValue(_this); EventHandler handler = table.ExtractHandler(token); if (handler != null) { _this.CanExecuteChanged -= handler; } }
// void CollectionChanged.remove(EventRegistrationToken token) internal void remove_CollectionChanged(EventRegistrationToken token) { INotifyCollectionChanged _this = Unsafe.As <INotifyCollectionChanged>(this); EventRegistrationTokenTable <NotifyCollectionChangedEventHandler> table = s_weakTable.GetOrCreateValue(_this); NotifyCollectionChangedEventHandler handler = table.ExtractHandler(token); if (handler != null) { _this.CollectionChanged -= handler; } }