protected override object LookupNamedResource (DependencyObject dob, string name)
{
if (name == null)
throw new XamlParseException ("you must specify a key in {StaticResource}");
object o = parser.LookupNamedItem (target_element, name);
if (o == null && !parsingBinding)
throw new XamlParseException (String.Format ("Resource '{0}' must be available as a static resource", name));
return o;
}