Пример #1
0
        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;
            }
        }
Пример #2
0
        // 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;
            }
        }
Пример #3
0
        // 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;
            }
        }