private void LoadXaml()
        {
            var loader = new XamlXmlLoader(new DummyXamlParserFactory(WiringContext));

            var rootObject = loader.Load(Xaml);

            Representation = ConvertToViewNodes(rootObject);
        }
Beispiel #2
0
        public void LoadWithRootInstance()
        {
            var dummy = new DummyClass
            {
                AnotherProperty = "Other value",
                SampleProperty = "Will be overwritten"
            };

            var loader = new XamlXmlLoader(new ObjectAssembler(WiringContext, new ObjectAssemblerSettings { RootInstance = dummy }), WiringContext);
            var actual = loader.Load("<DummyClass xmlns=\"root\" SampleProperty=\"Value\" />");

            Assert.IsInstanceOfType(actual, dummy.GetType());
            Assert.AreEqual(((DummyClass)actual).SampleProperty, "Value");
            Assert.AreEqual(((DummyClass)actual).AnotherProperty, "Other value");
        }
Beispiel #3
0
        public void LoadWithRootInstance()
        {
            var dummy = new DummyClass
            {
                AnotherProperty = "Other value",
                SampleProperty  = "Will be overwritten"
            };

            var loader = new XamlXmlLoader(new DummyXamlParserFactory(WiringContext));

            var actual = loader.Load("<DummyClass xmlns=\"root\" SampleProperty=\"Value\" />", dummy);

            Assert.IsInstanceOfType(actual, dummy.GetType());
            Assert.AreEqual("Value", ((DummyClass)actual).SampleProperty);
            Assert.AreEqual("Other value", ((DummyClass)actual).AnotherProperty);
        }
Beispiel #4
0
 public object Load(Stream stream)
 {
     return(innerLoader.Load(stream));
 }