private static Type GetTargetType (XamlTypeConverter converter)
{
XamlElement p = converter.parser.CurrentElement.Parent;
XamlObjectElement parent = p as XamlObjectElement;
if (p == null)
throw new XamlParseException ("Attempting to create a DP from an item without a target property.");
if (parent == null)
parent = p.Parent as XamlObjectElement;
if (parent == null)
throw new XamlParseException ("Attempting to create a DP from an item without a target property.");
Style s = parent.Object as Style;
if (s == null)
throw new XamlParseException ("Attempting to create a DP from a non style object.");
return s.TargetType;
}
}