This repository was archived by the owner on Oct 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments