This project is read-only.
1

Closed

Application Commands no longer workin

description

Application Commands do not longer work. Look in the Fulten Ribbon Example.

I've inserted a TextBox in the TestContent, but when it has Focus, the Past/Copy Commands are not Enabled!
Closed Jan 30, 2015 at 9:59 AM by batzen

comments

batzen wrote Sep 29, 2014 at 6:42 PM

This happens because the buttons no longer set
FocusManager.SetIsFocusScope(this, true);
This was changed because it caused many other problems (binding issues to name one). If you want it to work again you would have to set that on the buttons you want to work with those commands. I can't really tell you why the commands only work when they are a focus scope themselves, but my guess is that the textbox would loose focus on button click thus requiring the button to be in a different focus scope.

The paste button does no longer work because the DropDownButton no longer inherits from MenuBase but from ItemsControl instead. This was changed because inheriting from MenuBase causes lots of problems to WindowsFormsHost and the popup handling in the DropDownButton itself.

If you've got any ideas on how to better solve those problems i would be happy to hear them.

batzen wrote Sep 29, 2014 at 6:43 PM

The FocusScope was removed in revision 761 and the inheritance of DropDownButton was changed in revision 860, to be exact.

jogibear9988 wrote Sep 29, 2014 at 9:17 PM

I've now added FocusManager.IsFocusScope="True" to my Root Ribbon in XAML, then it works again.

Maybe you only set the Root Ribbon as Focus Scope? Or are there then still Binding errors?

batzen wrote Sep 29, 2014 at 9:41 PM

Setting IsFocusScope on the Ribbon will make those buttons work if focus is outside the Ribbon, but not when focus is inside the Ribbon. You would still be required to set IsFocusScope on the Buttons. I updated the Showcase application to give an example of how it should be done.

jogibear9988 wrote Sep 29, 2014 at 10:09 PM

Yes, but what will be the real Solution? How Handles Microsoft Ribbon this Problem?

batzen wrote Sep 29, 2014 at 10:44 PM

Good question. Would you mind finding out how it is done there?