@ -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 ) ;
}