Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit f1da926

Browse files
author
gumme
committed
Added tests for testing property values set as element, with proper prefix for types outside default XML-namespace.
1 parent ee33a1c commit f1da926

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/SetPropertyTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,30 @@ public void SetInstanceProperty()
7272
button.Properties.GetProperty("Width").SetValue(10);
7373
AssertCanvasDesignerOutput("<Button Width=\"10\" />", button.Context);
7474
}
75+
76+
[Test]
77+
public void SetInstancePropertyElement()
78+
{
79+
DesignItem button = CreateCanvasContext("<Button />");
80+
DesignItem canvas = button.Parent;
81+
82+
canvas.Properties.GetProperty(Canvas.TagProperty).SetValue(new ExampleClass());
83+
84+
DesignItem customControl = canvas.Services.Component.RegisterComponentForDesigner(new ICSharpCode.WpfDesign.Tests.Controls.CustomButton());
85+
canvas.Properties["Children"].CollectionElements.Add(customControl);
86+
customControl.Properties.GetProperty(ICSharpCode.WpfDesign.Tests.Controls.CustomButton.TagProperty).SetValue(new ExampleClass());
87+
88+
AssertCanvasDesignerOutput("<Canvas.Tag>\n" +
89+
" <t:ExampleClass />\n" +
90+
"</Canvas.Tag>\n" +
91+
"<Button />\n" +
92+
"<sdtcontrols:CustomButton>\n" +
93+
" <sdtcontrols:CustomButton.Tag>\n" +
94+
" <t:ExampleClass />\n" +
95+
" </sdtcontrols:CustomButton.Tag>\n" +
96+
"</sdtcontrols:CustomButton>",
97+
canvas.Context,
98+
"xmlns:sdtcontrols=\"http://sharpdevelop.net/WpfDesign/Tests/Controls\"");
99+
}
75100
}
76101
}

0 commit comments

Comments
 (0)