internal void UpdateTargetedParentReference(
            DependencyObject dependencyObject,
            DependencyObject rootExecutionContext,
            ref object newValue)
        {
            var selectorTreeResolutionContext = new SelectorTreeResolutionContext(rootExecutionContext);
            var resolvedObject  = Selector.Resolve(dependencyObject, ref selectorTreeResolutionContext);
            var currentSelector = Selector.NextSelector;

            while (currentSelector != null)
            {
                resolvedObject  = currentSelector.Resolve(resolvedObject, ref selectorTreeResolutionContext);
                currentSelector = currentSelector.NextSelector;
            }
            var targetedRefExecutionFrame = selectorTreeResolutionContext.GetLastFrame();
            var parentExecutionFrame      = selectorTreeResolutionContext.GetBacktracedFrame(1);

            //the itemscontrol
            var resolvedParentElement = parentExecutionFrame.ResolvedValue;

            var targetedElementPropertySelector = targetedRefExecutionFrame.SelectorInstance as PropertySelector;

            //var targetedElementArraySelector = targetedRefExecutionFrame.SelectorInstance as ArrayElementSelector;

            if (targetedElementPropertySelector == null)
            {
                throw new NotSupportedException();
            }

            var targetedElementPropertyName = targetedElementPropertySelector.PropertyName;

            resolvedParentElement.SetPropertyValue(targetedElementPropertyName, newValue);
        }
        //TODO implement other selectors like array accessors?

        internal IAnimatable ResolveSelectorTree(DependencyObject dependencyObject, DependencyObject rootExecutionContext)
        {
            var selectorTreeResolutionContext = new SelectorTreeResolutionContext(rootExecutionContext);
            var resolvedObject  = Selector.Resolve(dependencyObject, ref selectorTreeResolutionContext);
            var currentSelector = Selector.NextSelector;

            while (currentSelector != null)
            {
                resolvedObject  = currentSelector.Resolve(resolvedObject, ref selectorTreeResolutionContext);
                currentSelector = currentSelector.NextSelector;
            }
            return((IAnimatable)resolvedObject);
        }