SplitContainer Class

DevZest WPF Docking

SplitContainer Class
Represents a control consisting of two resizable UIElement objects.
Inheritance Hierarchy
SystemObject  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            DevZest.WindowsSplitContainer

Namespace: DevZest.Windows
Assembly: DevZest.WpfDocking (in DevZest.WpfDocking.dll) Version: 2.5.0.0 (2.5.5912.0)
Syntax
public class SplitContainer : FrameworkElement
Public Class SplitContainer
	Inherits FrameworkElement

The SplitContainer type exposes the following members.

Constructors
  NameDescription
Public methodSplitContainer
Initializes a new instance of the SplitContainer class.
Top
Properties
  NameDescription
Public propertyBackground
Gets or sets the Brush used to fill the background. This is a dependency property.
Public propertyChild1
Gets or sets the left or top child of the SplitContainer, depending on Orientation. This is a dependency property.
Public propertyChild1MinSize
Gets or sets the minimum distance, in device-independent units (1/96th inch per unit), of the splitter from the left or top edge of SplitContainer. This is a dependency property.
Public propertyChild2
Gets or sets the right or bottom child of the SplitContainer, depending on Orientation. This is a dependency property.
Public propertyChild2MinSize
Gets or sets the minimum distance, in device-independent units (1/96th inch per unit), of the splitter from the right or bottom edge of SplitContainer. This is a dependency property.
Public propertyDragIncrement
Gets or sets the minimum distance that a user must use the mouse to drag the splitter. This is a dependency property.
Public propertyIsPreviewVisible
Gets the value indicates whether the preview is visible. This is a dependency property.
Public propertyIsSplitterTopLeft
Gets or sets a value indicating whether the SplitterDistance property specifies the size of Child1 or Child2. This is a dependency property.
Public propertyKeyboardIncrement
Gets or sets the distance that each press of an arrow key moves the splitter. This is a dependency property.
Public propertyOrientation
Gets or sets a value indicating the horizontal or vertical orientation of the SplitContainer children. This is a dependency property.
Public propertyPreviewOffsetX
Gets the X-axis value of the drag preview offset. This is a dependency property.
Public propertyPreviewOffsetY
Gets the Y-axis value of the drag preview offset. This is a dependency property.
Public propertyPreviewTemplate
Gets or sets the DataTemplate of the dragging preview.
Public propertyShowsPreview
Gets or sets a value that indicates whether the SplitContainer updates SplitterDistance as the user drags the splitter. This is a dependency property.
Public propertySplitterDistance
Gets or sets a value indicating the size of Child1 or Child2, depending on the value of IsSplitterTopLeft. This is a dependency property.
Public propertySplitterPresenter
Gets the ContentPresenter of the splitter. This is a dependency property.
Public propertySplitterPresenterStyle
Gets or sets the splitter ContentPresenter. This is a dependency property.
Public propertySplitterTemplate
Gets or sets the data template of the splitter (movable bar). This is a dependency property.
Public propertySplitterWidth
Gets or sets the width of the splitter, in device-independent units (1/96th inch per unit). This is a dependency property.
Top
Fields
  NameDescription
Public fieldStatic memberBackgroundProperty
Identifies the Background dependency property.
Public fieldStatic memberChild1MinSizeProperty
Identifies the Child1MinSize dependency property.
Public fieldStatic memberChild1Property
Identifies the Child1 dependency property.
Public fieldStatic memberChild2MinSizeProperty
Identifies the Child2MinSize dependency property.
Public fieldStatic memberChild2Property
Identifies the Child2 dependency property.
Public fieldStatic memberDragIncrementProperty
Identifies the DragIncrement dependency property.
Public fieldStatic memberIsPreviewVisibleProperty
Identifies the IsPreviewVisible dependency property.
Public fieldStatic memberIsSplitterTopLeftProperty
Identifies the IsSplitterTopLeft dependency property.
Public fieldStatic memberKeyboardIncrementProperty
Identifies the KeyboardIncrement dependency property.
Public fieldStatic memberOrientationProperty
Identifies the Orientation dependency property.
Public fieldStatic memberPreviewOffsetXProperty
Identifies the PreviewOffsetX dependency property.
Public fieldStatic memberPreviewOffsetYProperty
Identifies the PreviewOffsetY dependency property.
Public fieldStatic memberPreviewTemplateProperty
Identifies the PreviewTemplate dependency property.
Public fieldStatic memberShowsPreviewProperty
Identifies the ShowsPreview dependency property.
Public fieldStatic memberSplitterDistanceProperty
Identifies the SplitterDistance dependency property.
Public fieldStatic memberSplitterPresenterProperty
Identifies the SplitterPresenter dependency property.
Public fieldStatic memberSplitterPresenterStyleProperty
Identifies the SplitterPresenterStyle dependency property.
Public fieldStatic memberSplitterTemplateProperty
Identifies the SplitterTemplate dependency property.
Public fieldStatic memberSplitterWidthProperty
Identifies the SplitterWidth dependency property.
Top
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.
XAML
<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>
See Also