次のxamlを使用して、RibbonGroupといくつかのRibbonButtonをビューモデルにバインドしようとしています:
<Style TargetType="{x:Type ribbon:RibbonGroup}" x:Key="RibbonGroupStyle">
<Setter Property="Header" Value="{Binding Header}" />
<Setter Property="ItemContainerStyle" Value="{DynamicResource RibbonButtonStyle}" />
<Setter Property="ItemsSource" Value="{Binding Buttons}" />
</Style>
<Style TargetType="{x:Type ribbon:RibbonButton}" x:Key="RibbonButtonStyle">
<Setter Property="Label" Value="{Binding Header}" />
</Style>
これにより、次のエラーが表示されますが、これは理解できますが、RibbonButton のラベルをビューモデルに適切にバインドするにはどうすればよいですか?
A style intended for type 'RibbonButton' cannot be applied to type 'RibbonControl'.