Is it possible to modify the application menu's drop position for the 10/2010 WPF ribbon? I think it's very unusual that a menu opens at the leftmost position, so I'd like to change that.
Example: in Word 2007 (which - as you probable all know - has the old ribbon design) the application menu opens as far as possible to the right. I'd like to get this behaviour, too, because at the right is the only sensible position for the menu. All its entries are in the left column, which was right below the button then. I've not found any easy way to assign its left position. Does anybody know if and how this is possible?
Okay, after many hours of try and error, I found a possible way to do it. It's not the 100% original behaviour like in "Windows 7 Paint" or similar Windows 7 ribbon applications, but in most cases it works.
First, you need to know that the application menu is realized with a
Popup
, which has aPlacement
property to define where the popup is opened. You need to override the default behaviour toPlacementMode.Left
. This will make the popup menu open up right next to the menu button.Next, you need to set the
Popup.HorizontalOffset
property to the negatedRibbonApplicationMenu.Width
. This is done via Binding and a converter to negate the value.The converter is defined in the
RibbonWindow.Resources
as follows:The
local
namespace has to be declared inside of theRibbonWindow
:And finally, the code for the
NegateIntegerConverter
is a class in the application's root namespace:Now for the difference in behaviour: if the menu cannot fully expand to the right because the screen is ending there, the popup does not simply open up a bit farther to the left, but completely on the left. Maybe I can find out how it's actually behaving like the "Windows 7 Paint" ribbon's menu, but this is a good workaround until then.