public void StoreGetSet () { var a = new AttachedWrapper2 (); AttachedWrapper2.SetFoo (a, "x"); string v; Assert.IsFalse (AttachablePropertyServices.TryGetProperty<string> (a, AttachedWrapper2.FooIdentifier, out v), "#1"); Assert.AreEqual ("x", AttachedWrapper2.GetFoo (a), "#2"); Assert.AreEqual (1, AttachedWrapper2.PropertyCount, "#3"); }
public void Read_AttachedProperty2 () { var obj = new AttachedWrapper2 (); AttachedWrapper2.SetFoo (obj, "x"); AttachedWrapper2.SetFoo (obj.Value, "y"); try { new XamlObjectReader (obj); //while (xr.Read ()) Console.Error.WriteLine ("{0} {1} {2} {3}", xr.NodeType, xr.Type, xr.Member, xr.Value); } finally { AttachedWrapper2.SetFoo (obj, null); AttachedWrapper2.SetFoo (obj.Value, null); } }