Beispiel #1
0
        private void ClickEasingFunctionPreviewIcon(UIElement placementTarget)
        {
            this.EnsureTransitionSceneNode();
            if (this.ActiveSceneViewModel == null)
            {
                return;
            }
            this.ActiveSceneViewModel.TransitionSelectionSet.SetSelection(this.sceneNode);
            VisualStateTransitionEditor transitionEditor  = new VisualStateTransitionEditor(this.sceneNode);
            PropertyReference           propertyReference = new PropertyReference((ReferenceStep)this.sceneNode.ProjectContext.ResolveProperty(VisualStateTransitionSceneNode.GeneratedEasingFunctionProperty));
            IType type = this.sceneNode.ProjectContext.ResolveType(ProjectNeutralTypes.IEasingFunction);

            if (!this.sceneNode.ProjectContext.PlatformMetadata.IsNullType((ITypeId)type))
            {
                this.easingFunctionProperty = transitionEditor.VisualTransitionObjectSet.CreateSceneNodeProperty(propertyReference, TypeUtilities.GetAttributes(type.RuntimeType));
                this.easingFunctionProperty.PropertyReferenceChanged += new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.easingFunctionProperty_PropertyReferenceChanged);
            }
            this.popup = new EasingEditorPopup(this.easingFunctionProperty, this.TransitionSceneNode.ViewModel.DefaultView);
            this.TransitionSceneNode.ViewModel.Closing += new EventHandler(this.ViewModel_Closing);
            this.popup.SynchronousClosed += (EventHandler)((sender, e) =>
            {
                if (this.TransitionSceneNode.IsAttached && this.TransitionSceneNode.ViewModel != null)
                {
                    this.TransitionSceneNode.ViewModel.TransitionSelectionSet.Clear();
                }
                if (this.easingFunctionProperty != null)
                {
                    this.easingFunctionProperty.OnRemoveFromCategory();
                    this.easingFunctionProperty.PropertyReferenceChanged -= new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.easingFunctionProperty_PropertyReferenceChanged);
                    this.easingFunctionProperty = (SceneNodeProperty)null;
                }
                this.TransitionSceneNode.ViewModel.Closing -= new EventHandler(this.ViewModel_Closing);
                this.popup = (EasingEditorPopup)null;
            });
            this.popup.Placement       = PlacementMode.Bottom;
            this.popup.PlacementTarget = placementTarget;
            this.popup.IsOpen          = true;
        }
 public VisualTransitionObjectSet(VisualStateTransitionSceneNode sceneNode, VisualStateTransitionEditor transactionContext)
     : base(sceneNode.DesignerContext, (IPropertyInspector)transactionContext)
 {
     this.sceneNode = sceneNode;
 }