private void LoadXaml() { var loader = new XamlXmlLoader(new DummyXamlParserFactory(WiringContext)); var rootObject = loader.Load(Xaml); Representation = ConvertToViewNodes(rootObject); }
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"); }
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); }
public object Load(Stream stream) { return(innerLoader.Load(stream)); }