Adding Command to Ribbon button

Ribbon for WPF Forum

Posted 16 years ago by Balaram Barange
Version: 4.5.0476
Avatar
Hi,

I am getting a strange problem, when I add commands to ribbon buttons. The buttons gets disabled as soon as I click on any other area in the window. What could be the reason for this?

Thanks,
Bala

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Our Ribbon is designed to work just like a regular WPF Menu and Toolbar. Basically if you have a CommandTarget assigned to a button, it will operate directly on that element and its enabled state will related to that element as well. If no CommandTarget is used (which is the case most of the time), the command searches for a handler at or "above" the currently focused element in the main focus scope. So if you move focus outside of the main focus scope where there is no handler for a command, it will disable. This is standard WPF command processing behavior, and I'm sure you can find a lot more info on it by searching the MSDN.


Actipro Software Support

The latest build of this product (v24.1.3) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.