Synchronizing Commands on change in WindowsFormsHost

Ribbon for WPF Forum

Posted 10 years ago by Martin de Jong - Statistics Netherlands
Version: 4.5.0486
Avatar
Hi

I have a WPF application with a ribbon. within the ribbon there are buttons with an ApplicationCommand attached, like ApplicationCommands.Copy

The application uses the syntaxeditor in a WindowsFormsHost conrol. The binding is set with some bindings.Add. This works one way completely. Clicking a button will activate the commandcode in the editor.

However, the enabling and disabling of the commandbuttons is not working nicely. I have to click on the ribbon to get the ribbon reflecting the correct state and activating the several command canexecute methods.

So how can i trigger the main application to refresh the ribbon command states after an action in the forms editor, e.g. using code in the selection_changed event.

I hope this is clear :)

Regards
Martin

PS I know this is a bit a wpf question:)

Comments (1)

Posted 10 years ago by Martin de Jong - Statistics Netherlands
Avatar
i found it:

CommandManager.InvalidateRequerySuggested();
The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.