Multiple image sources for a Ribbon Button

Ribbon for WPF Forum

Posted 15 years ago by Brian Stewart
Version: 4.5.0485
Avatar
Hi, I have a ribbon in my app, and I have been using the ribbon button for a particular command on one of the ribbon tabs, but now I would like to animate between two different images on the button, depending on whether the mouse is hovering over the button or not. I understand the ribbon button does not normally support this - but is there some WPF trick where I can do this? Adam Nathan shows a simple example of doing this with two Image controls in his book WPF Unleashed, but when I try to put a regular button with a child Image control in my ribbon, it doesn't look right, and then when I click it I get a gigantic popup that covers half my screen. Any ideas, clues, or places to start reading would be welcome!

Brian

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Brian,

We haven't tried however perhaps you could make a Style for ribbon:Button and in the Style, add a Trigger on IsMouseOver = true. Then in the Setter for that trigger, update the ImageSourceLarge / ImageSourceSmall properties with your hover images. That may do the trick.


Actipro Software Support

Posted 15 years ago by Brian Stewart
Avatar
Thanks for the tip, the effect I was going for involved the opacity varying over time, instead of an instantaneous switch - but that will hopefully work well enough.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Brian,

If you are a customer we can send you the default styles and you can make a subclass of Button that has additional hover image properties. You could update the styles to work on your subclass and add in template triggers that do animated fades of the images.


Actipro Software Support

The latest build of this product (v24.1.1) 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.