Represents a control consisting of two resizable UIElement objects.

Namespace: DevZest.Windows
Assembly: DevZest.WpfDocking (in DevZest.WpfDocking.dll)

Syntax

C#
public class SplitContainer : FrameworkElement
Visual Basic
Public Class SplitContainer _
	Inherits FrameworkElement

Remarks

You can add two UIElement children to the two resizable areas, and you can add other SplitContainer controls to existing SplitContainer to create many resizable display areas.

Use the SplitContainer control to divide the display area of a container (such as a Window) and allow the user to resize UI elements that are added to the SplitContainer panels. When the user passes the mouse pointer over the splitter, the cursor changes to indicate that the controls inside the SplitContainer control can be resized.

Use Child1 and Child2 to specify two resizable children. Use Orientation to specify horizontal orientation. The default orientation of the SplitContainer is vertical.

Use SplitterDistance and IsSplitterTopLeft to specify where the splitter starts. Double click the splitter auto sizes Child1 or Child2, depending on the value of IsSplitterTopLeft. Use ShowsPreview to indicate whether SplitterDistance updated as the user drags the splitter. Use DragIncrement and KeyboardIncrement to specify how far the splitter moves at a time. The default for DragIncrement is 1 and KeyboardIncrement is 10.

Use Child1MinSize and Child2MinSize to specify how close the splitter bar can be moved to the outside edge of a SplitContainer. The default value is 20.

Use SplitterWidth, SplitterPresenterStyle, SplitterTemplate, PreviewTemplate, IsPreviewVisible, PreviewOffsetX and PreviewOffsetY properties to customize the splitter and drag preview.

Examples

The following example shows a sample use of SplitContainer.
CopyXAML
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:dz="http://schemas.devzest.com/presentation"
    Width="300" Height="300">
    <dz:SplitContainer>
        <dz:SplitContainer.Child1>
            <Button Content="Button1"/>
        </dz:SplitContainer.Child1>
        <dz:SplitContainer.Child2>
            <dz:SplitContainer Orientation="Horizontal" ShowsPreview="False">
                <dz:SplitContainer.Child1>
                    <Button Content="Button2"/>
                </dz:SplitContainer.Child1>
                <dz:SplitContainer.Child2>
                    <Button Content="Button3"/>
                </dz:SplitContainer.Child2>
            </dz:SplitContainer>
        </dz:SplitContainer.Child2>
    </dz:SplitContainer>
</Window>

Inheritance Hierarchy

See Also