Fully customizable WPF SplitContainer built from scratch, resizes two child window via movable splitter.Introduction
Windows Forms has a very handy SplitContainer control that you can use to resize two child panels. In WPF world we're out of the luck - we must use Grid and GridSplitter which is not intuive, and most importantly, can only data binding to a collection of children instead of the fixed number of 2. As we all know, data binding is the bridge between Model and View in WPF, and the greatest part (at least from my point of view) is the seperation of Model and View (or named as business logic and presentation).
So we decided to develop a custom panel (SplitContainer class) just like Windows Forms SplitContainer, which resizes two children as the value of Child1 and Child2 dependency property. It also supports auto-resize by double clicking the splitter, resizing by keyboard arrow keys, etc. The splitter, and resizing preview, can be fully customized. You can build endless layout complexity by nesting more SplitContainers.
The SplitContainer is part of DevZest WPF Docking
, a undo/redo-able commercial docking library for WPF, as a Free Feature that you can use FREE OF CHARGE for both commercial and non-commercial applications. We decided to make this class open source as a contribution to the WPF development community.
Please note the downloadable source code is under GPL license and cannot be used for proprietary software. To use SplitContainer for proprietary software, you can download and install our WPF Docking
product, and obtain a Free Feature License through installed License Console, FREE OF CHARGE. This additional couple of clicks brings you extra benefits of commercial product quality documentation, upgrade and free technical support
.ResourcesThe DevZest Blog - tutorials, samples and articlesOnline documentation