public PropertyExpression (PathExpression expression, string propertyName) { PropertyName = propertyName; Source = expression.Property; if (Source != null) { if (Source.Value != null) Property = (Source.Value as DependencyObject).GetProperty (propertyName); Source.DependencyPropertyValueChanged += HandlePropertyValueChanged; } expression.GetProperty ("Property").DependencyPropertyValueChanged += HandlePropertyChanged; }
public Binding (PathExpression source, PathExpression target, IValueConverter converter) { Source = source; Target = target; Converter = converter; SourceProperty = Source.Property; TargetProperty = Target.Property; Source.GetProperty ("Property").DependencyPropertyValueChanged += HandleSourcePropertyChanged; Target.GetProperty ("Property").DependencyPropertyValueChanged += HandleTargetPropertyChanged; UpdateTargetValue (); if (SourceProperty != null) SourceProperty.DependencyPropertyValueChanged += HandleSourceValueChanged; if (TargetProperty != null) TargetProperty.DependencyPropertyValueChanged += HandleTargetValueChanged; }
public AttachedPropertyExpression (PathExpression expression, object item, string propertyName) { PropertyName = propertyName; Item = item; Source = expression.Property; if (Source != null) { var container = Source.Value as IAttachedPropertiesContainer; if (container != null) { Property = container.GetProperty (item, propertyName); container.AddedItem += HandleAddedItem; container.RemovedItem += HandleRemovedItem; } Source.DependencyPropertyValueChanged += HandlePropertyValueChanged; } expression.GetProperty ("Property").DependencyPropertyValueChanged += HandlePropertyChanged; }