Esempio n. 1
0
        private void UpdateHandlers(PropertyValue oldPropertyValue, PropertyValue newPropertyValue)
        {
            if (oldPropertyValue != null)
            {
                SceneNodeProperty sceneNodeProperty = oldPropertyValue.get_ParentProperty() as SceneNodeProperty;
                if (sceneNodeProperty != null)
                {
                    sceneNodeProperty.PropertyReferenceChanged -= new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.OnPropertyPropertyReferenceChanged);
                    sceneNodeProperty.remove_PropertyChanged(new PropertyChangedEventHandler(this.OnPropertyPropertyChanged));
                    this.ChangeActiveEditMode((PropertyContainerEditMode)0);
                }
            }
            if (newPropertyValue == null)
            {
                return;
            }
            SceneNodeProperty sceneNodeProperty1 = newPropertyValue.get_ParentProperty() as SceneNodeProperty;

            if (sceneNodeProperty1 == null)
            {
                return;
            }
            sceneNodeProperty1.PropertyReferenceChanged += new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.OnPropertyPropertyReferenceChanged);
            sceneNodeProperty1.add_PropertyChanged(new PropertyChangedEventHandler(this.OnPropertyPropertyChanged));
        }
Esempio n. 2
0
        private static void OnAssociatedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
        {
            PropertyMarker    propertyMarker    = (PropertyMarker)d;
            SceneNodeProperty sceneNodeProperty = args.OldValue as SceneNodeProperty;

            if (sceneNodeProperty != null)
            {
                sceneNodeProperty.remove_PropertyChanged(new PropertyChangedEventHandler(propertyMarker.AssociatedProperty_PropertyChanged));
            }
            if (propertyMarker.AssociatedProperty != null)
            {
                propertyMarker.SetValue(AutomationElement.IdProperty, (object)(((PropertyEntry)propertyMarker.AssociatedProperty).get_PropertyName() + "_Marker"));
                propertyMarker.UpdateBrushFromValueSource();
                propertyMarker.AssociatedProperty.add_PropertyChanged(new PropertyChangedEventHandler(propertyMarker.AssociatedProperty_PropertyChanged));
            }
            if (!propertyMarker.IsPickingElementProperty)
            {
                return;
            }
            propertyMarker.elementPropertyPicker.CancelEditing();
            propertyMarker.elementPropertyPicker = (PickWhipEngine)null;
        }