Framework-Class-Library-Extension
Framework-Class-Library-Extension copied to clipboard
CommandBinding does not work in styles.
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>