Browse Source

Fixed ignored SetPropertyTests; Must set the property value on the DesignItem representing the object, otherwise the value will not get written to XAML.

pull/68/head
gumme 12 years ago
parent
commit
0b59cb78ae
  1. 10
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/SetPropertyTests.cs

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

@ -21,20 +21,22 @@ namespace ICSharpCode.WpfDesign.Tests.Designer @@ -21,20 +21,22 @@ namespace ICSharpCode.WpfDesign.Tests.Designer
AssertCanvasDesignerOutput("<Button Width=\"100\" Height=\"200\" Content=\"{Binding}\" />", button.Context);
}
[Test, Ignore("Properties are not present in XAML DOM")]
[Test]
public void SetContentToStaticResource()
{
DesignItem button = CreateCanvasContext(@"<Button Width='100' Height='200'/>");
button.Properties.GetProperty("Content").SetValue(new StaticResourceExtension("MyBrush"));
button.Properties.GetProperty("Content").SetValue(new StaticResourceExtension());
button.Properties.GetProperty("Content").Value.Properties["ResourceKey"].SetValue("MyBrush");
// TODO : maybe we should support positional arguments from ctors as well => {StaticResource MyBrush}?
AssertCanvasDesignerOutput("<Button Width=\"100\" Height=\"200\" Content=\"{StaticResource ResourceKey=MyBrush}\" />", button.Context);
}
[Test, Ignore("Properties are not present in XAML DOM")]
[Test]
public void SetContentToXStatic()
{
DesignItem button = CreateCanvasContext("<Button Width='100' Height='200'/>");
button.Properties.GetProperty("Content").SetValue(new StaticExtension("Button.ClickModeProperty"));
button.Properties.GetProperty("Content").SetValue(new StaticExtension());
button.Properties.GetProperty("Content").Value.Properties["Member"].SetValue("Button.ClickModeProperty");
AssertCanvasDesignerOutput("<Button Width=\"100\" Height=\"200\" Content=\"{x:Static Member=Button.ClickModeProperty}\" />", button.Context);
}

Loading…
Cancel
Save