Docking/MDI vNext - MVVM Default Dock Locations

by Avatar Bill Henning (Actipro)
Thursday, August 27, 2015 at 12:41pm

PostBannerWPFControlsDevNotes

As mentioned in this previous post, we've been looking for ideas to further improve our WPF Docking/MDI product, which already is the market leader for docking tool window and MDI functionality.  We've committed to working on a complete internal restructuring of the product that we will call Docking/MDI vNext.  We're doing our best to keep the same general API surface, while providing even more advanced features in every area of the product.  We've collected suggestions from our customers over the past several years and are working to meet them as best we can with Docking/MDI vNext.

As mentioned in the previous post, we are currently working on enhancements for the MVVM support our Docking/MDI controls provide.  In today's post, we'll talk about new code being added that allows you to specify a default location for new tool windows that are opened.

Feature Description

As in the current version, when a tool window has already been in the dock site layout and then is closed, it leaves a breadcrumb behind so that it knows exactly where to appear when reopened later.  In vNext, for tool windows that are being opened for the first time and don't yet have a breadcrumb available, default location information is now requested.

The new DockingWindow.WindowGroupName property can be set on tool windows that have an affinity.  Each window in a 'group' should have the same property value.  A window being opened for the first time will look for other open members of the group in the same state so that it can attach to them.

DockingWindow also has a new DefaultLocationRequestAction property that can be set to a lambda that is passed a special event args instance.  The event args allows you to programmatically designate a dock target (such as a dock host or other tool window) and optional side upon which to dock.  Then the new DockSite.WindowDefaultLocationRequested event fires and allows for the similar logic to be applied, but at a centralized location.

If no dock target is designated by the action or event, then the window will dock against the primary dock host using the side specified by the window's new DefaultDockSide property.

Summary

With the properties and events mentioned above, vNext now gives you full control over where brand new tool windows will open in a layout by default.  These capabilities are essential for MVVM scenarios.

If you don't want to get into writing any code, simply set the WindowGroupName and DefaultDockSide properties.  Or if you do wish to have more complex logic and find-grained control, use either the DefaultLocationRequestAction or WindowDefaultLocationRequested event to supply your logic.  The choice is yours!

Docking/MDI vNext is currently still in mid-development stages but is progressing very well.  Please contact us via email if you are an existing customer and would like to sign up as a beta tester for vNext.  If you have any other suggestions for improving Docking/MDI, now is the time to get them in.  We'll post more updates on our vNext improvements soon.

In the meantime, please download our current Docking/MDI control product and give it a spin.

TaskDownload TaskLiveDemo TaskBuyNow

Tags: wpf, docking

Actipro's WPF Controls

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Learn More

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Includes editors, docking windows, MDI, property grids, charts, tree controls, ribbons, gauges, themes, and much more.

Learn More Download Free Trial

Add Comment

Please log in to a validated account to post comments.