protected IDataDescriptor GetDataDescriptor(UIElement element) { string targetName = Storyboard.GetTargetName(this); object targetObject = null; if (targetName == null) targetObject = element; else { INameScope ns = element.FindNameScope(); if (ns != null) targetObject = ns.FindName(targetName); if (targetObject == null) targetObject = element.FindElement(new NameMatcher(targetName)); if (targetObject == null) return null; } try { IDataDescriptor result = new ValueDataDescriptor(targetObject); if (_propertyExpression != null && _propertyExpression.Evaluate(result, out result)) return result; } catch (XamlBindingException e) { ServiceRegistration.Get<ILogger>().Warn("PropertyAnimationTimeline: Error evaluating expression '{0}' on target object '{1}'", e, _propertyExpression, targetObject); } return null; }