RoutedCommands across Docked Windows and Tools.

Docking/MDI for WPF Forum

Posted 16 years ago by JDEV
Version: 4.0.0456

Is there a (simple) way to get command targets working across tool and document windows.

VisualStudio style docking / window layouts. My active document window adds a commandbinding to MyCommands.InsertItem.

I have a tool window with a listview. Its items have a context menu item that triggers MyCommands.InsertItem with a parameter.

Problem: Since I have to focus on the tool window to the display context menu, my context menu item is disabled (because the document window is no longer active).

My work around is to bind to the command at the main window level, check for the LastActiveWindow and see if supports InsertItem, then call it directly.

[Modified at 09/05/2008 06:10 AM]

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hello, one thing we had tried out back when making the product was to make each tool window its own Focus Scope. That would have probably allowed this scenario to work however it had some nasty side effects. Namely I believe that you couldn't have had toolbars work on content within each individual tool window since they would be operating on the document instead.

What you have done as your workaround is similar to what I would have suggested, a way of "forwarding" the command over to the document.

If you have any suggestions for object model enhancements we could make to better handle these scenarios, please send them over. We'd love to discuss them.

Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.