Esempio n. 1
0
        public void additional_namespaces_can_be_specified()
        {
            var writer = new XamlWriter(_sw, new XamlWriterSettings(cfg => cfg.AddReference("foo", "Acme.SuperNameSpace", "Acme.SuperAssembly")));

            writer.Dispose();
            GeneratedOutput.Should().Contain(@"xmlns:foo=""clr-namespace:Acme.SuperNameSpace;assembly=Acme.SuperAssembly""");
        }
Esempio n. 2
0
        public void root_control_can_be_overridden()
        {
            var writer = new XamlWriter(_sw, new XamlWriterSettings(cfg => cfg.SetRootElement("StackPanel")));

            writer.Dispose();
            GeneratedOutput.Should().StartWith("<StackPanel");
        }
Esempio n. 3
0
        public void root_control_can_be_custom_control()
        {
            var writer = new XamlWriter(_sw, new XamlWriterSettings(cfg => cfg.AddReference("foo", "FooNameSpace").SetRootElement("foo:FooPanel")));

            writer.Dispose();
            GeneratedOutput.Should().StartWith("<foo:FooPanel");
        }
Esempio n. 4
0
        public void default_generates_empty_content_control()
        {
            var writer = new XamlWriter(_sw);

            writer.Dispose();
            GeneratedOutput.Should().StartWith("<ContentControl");
        }
Esempio n. 5
0
        public void add_nested_element()
        {
            var writer = new XamlWriter(_sw);

            writer.RegisterReference("query", "abc");
            writer.StartElement("query:Viewer", w => w.AddAttribute("Value", "{Binding}"));
            writer.Dispose();
            GeneratedOutput.Should().Contain("  <query:Viewer");
        }