Dispose() public method

public Dispose ( ) : void
return void
示例#1
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");
 }
示例#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");
 }
示例#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");
 }
示例#4
0
 public void default_generates_empty_content_control()
 {
     var writer = new XamlWriter(_sw);
     writer.Dispose();
     GeneratedOutput.Should().StartWith("<ContentControl");
 }
示例#5
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""");
 }