ribbon:Button stays highlighted after click

Ribbon for WPF Forum

Posted 16 years ago by Nathan McCarthy
Version: 4.0.0457
Hi guys,

First of all nice work on the controls!

I have a (hopefully) easy quetsion. I amusing ribbon Buttons elsewhere in the interface. Following a click, the button remains highlighted.

Any way to stop this from happening?

Comments (3)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Nathan,

It sounds like the Button is just keeping focus after being clicked, like a normal button would. What you would want to do is put the button in a focus scope (like menus) so that it can return focus to the main focus scope upon click. To do this, make the parent container of the button a focus scope with this in XAML:

Hope that helps!

Actipro Software Support

Posted 16 years ago by Nathan McCarthy
Hey there,

That makes sense now that I think about it - the normal WPF buttons have much more subdued highlight state so it doesn't stand out so much.

Thanks for the tip re. the IsFocusScope too - worked like a charm!
Posted 16 years ago by Mike Strobel - Software Engineer, CDC Software
Just a word of warning, I believe setting the container's IsFocusScope property to 'True' will change the default command targets of your buttons, so you may have to set your CommandTarget explicitly for the container. It's not something I have much experience with, but I do recall running into a command-related issue when experimenting with focus scopes.
The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.