Ejemplo n.º 1
0
        private void OnPropertyMarkerCommandsCustomExpressionCommand(object sender, ExecutedRoutedEventArgs eventArgs)
        {
            SceneNodeProperty associatedProperty = this.AssociatedProperty;

            if (associatedProperty != null)
            {
                using (WorkaroundPopup.LockOpen((DependencyObject)this))
                {
                    associatedProperty.DoEditCustomExpression((FrameworkElement)this);
                    PropertyMarker.ResetPropertyContainerMode((RoutedEventArgs)eventArgs);
                }
            }
            eventArgs.Handled = true;
        }
Ejemplo n.º 2
0
        private void OnPropertyMarkerCommandsTemplateBindingCommand(object sender, ExecutedRoutedEventArgs eventArgs)
        {
            SceneNodeProperty associatedProperty = this.AssociatedProperty;

            if (associatedProperty != null)
            {
                using (WorkaroundPopup.LockOpen((DependencyObject)this))
                {
                    associatedProperty.DoSetToTemplateBinding((TemplateBindablePropertyModel)eventArgs.Parameter);
                    PropertyMarker.ResetPropertyContainerMode((RoutedEventArgs)eventArgs);
                }
            }
            eventArgs.Handled = true;
        }
Ejemplo n.º 3
0
        private void OnPropertyMarkerCommandsClearValueCommand(object sender, ExecutedRoutedEventArgs eventArgs)
        {
            SceneNodeProperty associatedProperty = this.AssociatedProperty;

            if (associatedProperty != null)
            {
                using (WorkaroundPopup.LockOpen((DependencyObject)this))
                {
                    associatedProperty.DoClearValue();
                    PropertyMarker.ResetPropertyContainerMode((RoutedEventArgs)eventArgs);
                }
            }
            eventArgs.Handled = true;
        }
Ejemplo n.º 4
0
        private static void ResetPropertyContainerMode(RoutedEventArgs eventArgs)
        {
            PropertyContainer propertyContainer = PropertyMarker.GetOwningPropertyContainer(eventArgs);

            if (propertyContainer == null)
            {
                return;
            }
            PropertyMarker propertyMarker = eventArgs.Source as PropertyMarker;

            if (propertyMarker != null && propertyMarker.AssociatedProperty != propertyContainer.get_PropertyEntry())
            {
                return;
            }
            propertyContainer.set_ActiveEditMode((PropertyContainerEditMode)0);
        }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
0
        void IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ColorTabControl = (TabbedColorEditorControl)target;
                break;

            case 2:
                this.TabbedView = (TabControl)target;
                this.TabbedView.SelectionChanged += new SelectionChangedEventHandler(this.OnColorTabChanged);
                break;

            case 3:
                this.ColorEditorTabItem = (TabItem)target;
                break;

            case 4:
                this.ColorMarker = (PropertyMarker)target;
                break;

            case 5:
                this.ColorEditor = (ColorEditor)target;
                break;

            case 6:
                this.ColorResourceTabItem = (TabItem)target;
                break;

            case 7:
                this.ResourceList = (OnDemandControl)target;
                break;

            default:
                this._contentLoaded = true;
                break;
            }
        }
Ejemplo n.º 7
0
        private static void OnDotBrushChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
        {
            PropertyMarker propertyMarker = (PropertyMarker)d;

            propertyMarker.SetValue(Icon.GreenChromaProperty, (object)propertyMarker.DotBrush);
        }