コード例 #1
0
 void OnValueChanged(object sender, ValueChangedEventArgs e)
 {
     InvalidateCache(sender, e.PropertyDescriptor);
 }
コード例 #2
0
        void OnValueChanged(object sender, ValueChangedEventArgs e)
        {
            if (IsExtendedTraceEnabled(TraceDataLevel.Events))
            {
                TraceData.Trace(TraceEventType.Warning,
                                    TraceData.GotEvent(
                                        TraceData.Identify(_host.ParentBindingExpression),
                                        "ValueChanged",
                                        TraceData.Identify(sender)));
            }

            _host.OnSourcePropertyChanged(sender, e.PropertyDescriptor.Name);
        }
コード例 #3
0
            public ValueChangedRecord(ValueChangedEventManager manager, object source, PropertyDescriptor pd) 
            {
                // keep a strong reference to the source.  Normally we avoid this, but
                // it's OK here since its scope is exactly the same as the strong reference
                // held by the PD:  begins with pd.AddValueChanged, ends with 
                // pd.RemoveValueChanged.   This ensures that we _can_ call RemoveValueChanged
                // even in cases where the source implements value-semantics (which 
                // confuses the PD - see 795205). 
                _manager = manager;
                _source = source; 
                _pd = pd;
                _eventArgs = new ValueChangedEventArgs(pd);

                pd.AddValueChanged(source, new EventHandler(OnValueChanged)); 
            }