public XamlReflectionPropertySetter FindContentProperty ()
{
ContentPropertyAttribute [] atts = (ContentPropertyAttribute []) Type.GetCustomAttributes (typeof (ContentPropertyAttribute), true);
if (atts.Length == 0) {
// If there wasn't an explicitly set content property (via attributes)
// attempt to use a property named Content. Will return null if the
// property is not found.
Console.WriteLine ("using baked in content property.");
return XamlReflectionPropertyForName (Object, "Content");
}
ContentPropertyAttribute cpa = (ContentPropertyAttribute ) atts [0];
return XamlReflectionPropertyForName (Object, cpa.Name);
}