Hmm... I did this...
ActiproSoftware.Windows.Controls.Ribbon.Controls.ContextMenu contextMenu = new ActiproSoftware.Windows.Controls.Ribbon.Controls.ContextMenu();
ActiproSoftware.Windows.Controls.Ribbon.Controls.Menu menu = new ActiproSoftware.Windows.Controls.Ribbon.Controls.Menu();
menu.MouseLeftButtonDown += new MouseButtonEventHandler(menu_MouseLeftButtonDown);
contextMenu.Items.Add(menu);
if (e.Window is ToolWindow)
{
ActiproSoftware.Windows.Controls.Ribbon.Controls.Button mi = new ActiproSoftware.Windows.Controls.Ribbon.Controls.Button();
mi.Label = "Float";
mi.KeyTipAccessText = "F";
mi.Command = ApplicationCommands.DockWndFloat;
mi.CommandParameter = e.Window;
menu.Items.Add(mi);
mi = new ActiproSoftware.Windows.Controls.Ribbon.Controls.Button();
mi.Label = "Dock";
mi.KeyTipAccessText = "K";
mi.Command = ApplicationCommands.DockWndDock;
mi.CommandParameter = e.Window;
menu.Items.Add(mi);
<snip>
and simply have an empty handler for the mouse down event:
void menu_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
}
and it fixes the problem. Clicking on a non disabled item never gets to this point, so it doesn't seem to break anything.
Although, you'd have to do this for every menu in the application :(.
[Modified at 06/23/2010 03:43 PM]