Framework-Class-Library-Extension icon indicating copy to clipboard operation
Framework-Class-Library-Extension copied to clipboard

CommandBinding does not work in styles.

Open Whathecode opened this issue 11 years ago • 0 comments

When using CommandBinding in a style setter an exception containing the following message is thrown:

"The only supported MarkupExtension types are DynamicResourceExtension and BindingBase or derived types."

Example code:

<Style
    x:Key="EditButton"
    TargetType="Image"
    BasedOn="{StaticResource CommandButton}">
        <Setter Property="Source" Value="../Activity/ActionIcons/edit.png" />
        <Setter Property="behaviors:MouseBehavior.LeftClickCommand" Value="{wtc:CommandBinding {x:Static b:Commands.EditActivity}}" />
</Style>

Whathecode avatar May 13 '14 09:05 Whathecode