// - For root Type it returns TypeExtension.
// - For root Array it returns Array.
// - For non-root Type it returns Type.
+ // - For IXmlSerializable, it does not either return the raw IXmlSerializable or interpreted XData (it just returns null).
public virtual object Instance {
get {
var cur = NodeType == XamlNodeType.StartObject ? nodes.Current.Object.GetRawValue () : null;
- return cur == root ? root_raw : cur;
+ return cur == root ? root_raw : cur is XData ? null : cur;
}
}
Assert.IsTrue (r.Read (), "so#2-1");
Assert.AreEqual (XamlNodeType.StartObject, r.NodeType, "so#2-2");
Assert.AreEqual (XamlLanguage.XData, r.Type, "so#2-3");
+ if (r is XamlObjectReader)
+ Assert.IsNull (((XamlObjectReader) r).Instance, "xdata-instance");
Assert.IsTrue (r.Read (), "sm2#1");
Assert.AreEqual (XamlNodeType.StartMember, r.NodeType, "sm2#2");