0

I have a fluent.ribbon with the traditional buttons cut, copy and paste and try to hook up to the corresponding ApplicationCommands. However, the buttons are disabled and doesn't work as e.g. when having them in a menu. How can I use ApplicationCommands with fluent.ribbon?

The commands work with e.g. menuitems.

<Fluent:RibbonGroupBox Header="Clipboard">
    <Fluent:Button Header="Paste" Command="ApplicationCommands.Paste" Icon="./Assets/Paste_96x.png" LargeIcon="./Assets/Paste_96x.png"/>
    <Fluent:Button Header="Copy" Command="ApplicationCommands.Copy" SizeDefinition="Middle" Icon="./Assets/Copy_96x.png" LargeIcon="./Assets/Copy_32x.png"/>
    <Fluent:Button Header="Cut" Command="ApplicationCommands.Cut" SizeDefinition="Middle" Icon="./Assets/Cut_96x.png" LargeIcon="./Assets/Cut_96x.png"/>
</Fluent:RibbonGroupBox>
EricaC
  • 131
  • 1
  • 11

1 Answers1

1

Using FocusManager did the trick.

<Fluent:RibbonGroupBox Header="Clipboard">
    <Fluent:Button Header="Paste" Command="ApplicationCommands.Paste" FocusManager.IsFocusScope="True" Icon="./Assets/Paste_96x.png" LargeIcon="./Assets/Paste_96x.png"/>
    <Fluent:Button Header="Copy" Command="ApplicationCommands.Copy" FocusManager.IsFocusScope="True" SizeDefinition="Middle" Icon="./Assets/Copy_96x.png" LargeIcon="./Assets/Copy_32x.png"/>
    <Fluent:Button Header="Cut" Command="ApplicationCommands.Cut" FocusManager.IsFocusScope="True" SizeDefinition="Middle" Icon="./Assets/Cut_96x.png" LargeIcon="./Assets/Cut_96x.png"/>
</Fluent:RibbonGroupBox>
EricaC
  • 131
  • 1
  • 11