Пример #1
0
        public void Read_DefaultNamespaces_WithDefinedNamespace()
        {
#if PCL
            var settings = new XamlXmlReaderSettings();
            settings.AddNamespace(null, "urn:mono-test");
            settings.AddNamespace("x", "urn:mono-test2");
            var obj = (NamespaceTest.NamespaceTestClass)XamlServices.Load(GetReader("DefaultNamespaces_WithDefinedNamespace.xml", settings));
            Assert.IsNotNull(obj, "#1");
            Assert.AreEqual(obj.Foo, "Hello");
            Assert.AreEqual(obj.Bar, null);
#else
            Assert.Ignore("Not supported in System.Xaml");
#endif
        }
Пример #2
0
        public void Read_DefaultNamespaces_ClrNamespace()
        {
#if PCL
            var settings = new XamlXmlReaderSettings();
            settings.AddNamespace(null, Compat.TestAssemblyNamespace);
            settings.AddNamespace("x", XamlLanguage.Xaml2006Namespace);
            var obj = (TestClass5)XamlServices.Load(GetReader("DefaultNamespaces.xml", settings));
            Assert.IsNotNull(obj, "#1");
            Assert.AreEqual(obj.Bar, "Hello");
            Assert.AreEqual(obj.Baz, null);
#else
            Assert.Ignore("Not supported in System.Xaml");
#endif
        }