Exemple #1
0
        public BaseFrameworkElement GetRelativeTargetElement(DocumentNodePath relativeEditingContainerPath)
        {
            if (relativeEditingContainerPath.ContainerNode != this.DocumentNode)
            {
                return((BaseFrameworkElement)null);
            }
            DocumentNodePath containerOwnerPath = relativeEditingContainerPath.GetContainerOwnerPath();

            if (containerOwnerPath == null)
            {
                return((BaseFrameworkElement)null);
            }
            SetterSceneNode setterSceneNode = this.ViewModel.GetSceneNode(containerOwnerPath.Node) as SetterSceneNode;

            if (setterSceneNode == null)
            {
                return(this.ViewModel.GetSceneNode(containerOwnerPath.Node) as BaseFrameworkElement);
            }
            IStoryboardContainer storyboardContainer = (IStoryboardContainer)this.ViewModel.GetSceneNode(containerOwnerPath.ContainerNode);
            SceneNode            sceneNode           = storyboardContainer.ResolveTargetName(setterSceneNode.Target);

            if (sceneNode == storyboardContainer)
            {
                return(storyboardContainer.TargetElement);
            }
            return(sceneNode as BaseFrameworkElement);
        }
        private void RecacheTargetElement()
        {
            this.Invalidate();
            IStoryboardContainer storyboardContainer = this.StoryboardContainer;

            if (storyboardContainer == null)
            {
                return;
            }
            this.cachedTargetAvalonElement = storyboardContainer.ResolveTargetName(this.TargetName);
            this.cachedChangeStamp         = this.ViewModel.ChangeStamp;
        }