Maximize a DockingWindow when dragged to the top of the screen

Docking/MDI for WPF Forum

Posted 10 years ago by Clint David
Version: 13.1.0582
Avatar

Hi,

I want to maximize a DockingWindow/DocumentWindow/ToolWindow when i have dragged it on the top of the screen. Then when i pull it down, i want it to restore its size. This is the same behavior as a lot of windows right now (i.e. Visual Studio, MS Office, IE, Chrome).

At the RibbonWindow level, it already handles this behavior. I want to extend this behavior upto the DocumentWindows and ToolWindows. 

How should this be done?

Regards,

Clint

Comments (4)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Clint,

That feature is called Aero Snap in Windows, and occurs if you use Windows API to drag the window around.  In our WindowChrome (and RibbonWindow), we do use the Windows API for drags and that's why it works for those.

The dragging of docking windows is a different story though.  In our product, we aren't dragging an actual window when you drag the docking windows around.  We capture the mouse, show various preview adornments as appropriate, and wait for the mouse button to be released.  The window appears after you release the mouse button following a drag, assuming you ended up floating it. 

Visual Studio on the other hand immediately creates a real window when you drag, and the window tracks with the mouse.  Aero Snap kicks in for their docking windows since Windows API must be handing the drag. 

The only way we'd be able to support Aero Snap for docking windows is to completely rearchitect our dragging system to work the way VS does it.  I will make a note of the request, but that would be a massive change.


Actipro Software Support

Posted 10 years ago by Clint David
Avatar

Thanks for the reply!

I was wondering if there is a workaround. Sure we could capture the mouse position during the Dragging event. Document windows have the Maximize button, which is seen when it is in Float state. I was trying to look for the Property/Event where this button is tied up but i couldn't find one. Is there a way i could hook up to that Maximize button?

Regards,

Clint

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Clint,

I can't really think of a workaround for the dragging request at this time since we have to handle dragging to support the preview of the docking drop locations.  The chrome for the RaftingWindow is actually a WindowControl (part of RaftingWindow's template).  Our RaftingWindow handles the WindowControl's StateChanged method and then updates the RaftingWindow.WindowState property to match the WindowControl.WindowState value.  I'm not sure where you could track those events though since the button is handled in the WindowControl that is part of the RaftingWindow template.


Actipro Software Support

Posted 10 years ago by Clint David
Avatar

ok thanks anyway!

The latest build of this product (v24.1.1) 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.