In this article, I will show how can you create a
CommandBinding which "maps" one command to another in WPF, so you can use your MVVM architecture with the Microsoft Ribbon controls, avoiding the spaghetti code in "code-behind" files.
Some reading about the Ribbon controls and the MVVM:
- Ribbon Controls
RibbonControls and Commands
Not so long ago, Microsoft released the Ribbon controls for WPF. I started using it in one of my projects, but I realized that commands are not used like we would use them in WPF. Using the Ribbon controls, the
RibbonCommand represents a command on the ribbon (on the UI), it specifies how we will show it: