Block the Shift Escape functionality for the toolwindow.

Docking/MDI for WPF Forum

Posted 9 years ago by keshav bansal
Version: 13.2.0592


suppose i have two toolwindows(toolwindow1,toolwindow2) in my sample wpf application.

I focus the toolwindow1 by clicking on the toolwindow1 title bar.

Now i press the shift+escape key.Its closing the toolwindow1.

This blocking is acieved by handling the Preview key down event handler and set e.Handled=true.

But when i float the toolwindow1 and now i press the Shift+escape then it  not going  to that Preview key down  event handler.

So how to restrict the shift+escape while toolwindow is in floating state ?

Is there any generic mechanicm for it independent of the toolwindow state ?




Comments (1)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Keshav,

Key handlers only apply to the same root WPF Window that they are in.  When you float a docking window, it ends up going into a "rafting window" container, which is a separate WPF Window.  It get created by a call to DockSite.CreateRaftingWindow. 

You could make a class that inherits the DockSite class and override the CreateRaftingWindow method.  In your override, call its base implementation and look at the Window-based result.  Attach to the PreviewKeyDown event there with your own custom handler to block Shift+Esc.  Then return the Window object to the caller.

Actipro Software Support

The latest build of this product (v22.1.4) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.