Gave up finding "correct" way to deserialize XamlType and made it special case :(
authorAtsushi Eno <atsushi@ximian.com>
Wed, 17 Nov 2010 20:12:25 +0000 (05:12 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Wed, 17 Nov 2010 20:12:25 +0000 (05:12 +0900)
mcs/class/System.Xaml/System.Xaml/XamlObjectWriter.cs
mcs/class/System.Xaml/Test/System.Xaml/XamlObjectWriterTest.cs

index 21e67b2c7415dfeeb6a49d63491b42e6b8e2887f..254e02d85b83340e2a7331492e03e229d24dec28 100644 (file)
@@ -233,6 +233,12 @@ namespace System.Xaml
                                xt = XamlLanguage.Type;
                        if (xt == XamlLanguage.Type && value is string)
                                value = new TypeExtension ((string) value);
+
+                       // FIXME: this could be generalized by some means, but I cannot find any.
+                       if (xt.UnderlyingType == typeof (XamlType) && value is string) {
+                               var nsr = (IXamlNamespaceResolver) service_provider.GetService (typeof (IXamlNamespaceResolver));
+                               value = sctx.GetXamlType (XamlTypeName.Parse ((string) value, nsr));
+                       }
                        
                        if (value is MarkupExtension)
                                value = ((MarkupExtension) value).ProvideValue (service_provider);
index f1c26d7a1863c71720e2a11391ba34259294dc6e..cf0609c75be203aa1ee8f87ea9acf8d4fea50f4f 100755 (executable)
@@ -1078,7 +1078,6 @@ namespace MonoTests.System.Xaml
                }
                
                [Test]
-               [Category ("NotWorking")]
                public void Write_PropertyDefinition ()
                {
                        //var obj = new PropertyDefinition () { Modifier = "protected", Name = "foo", Type = XamlLanguage.String };