private void ParseObjectElement ()
{
Type t = ResolveType ();
if (t == null)
throw ParseException ("Unable to find the type {0}.", reader.LocalName);
object o = InstantiateType (t);
XamlObjectElement element = new XamlObjectElement (this, reader.LocalName, o);
SetElementTemplateScopes (element);
OnElementBegin (element);
ParseElementAttributes (element);
// This is a self closing element ie <Rectangle />
if (reader.IsEmptyElement)
OnElementEnd ();
}