C# Class DevZest.Windows.SplitContainer

Represents a control consisting of two resizable UIElement objects.

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, SplitterBackground, PreviewBackground, SplitterTemplate, IsPreviewVisible, PreviewOffsetX and PreviewOffsetY properties to customize the splitter and drag preview.

Inheritance: System.Windows.FrameworkElement
Datei anzeigen Open project: TNOCS/csTouch Class Usage Examples

Public Properties

Property Type Description
BackgroundProperty System.Windows.DependencyProperty
Child1MinSizeProperty System.Windows.DependencyProperty
Child1Property System.Windows.DependencyProperty
Child2MinSizeProperty System.Windows.DependencyProperty
Child2Property System.Windows.DependencyProperty
DragIncrementProperty System.Windows.DependencyProperty
IsPreviewVisibleProperty System.Windows.DependencyProperty
IsSplitterTopLeftProperty System.Windows.DependencyProperty
KeyboardIncrementProperty System.Windows.DependencyProperty
OrientationProperty System.Windows.DependencyProperty
PreviewBackgroundProperty System.Windows.DependencyProperty
PreviewOffsetXProperty System.Windows.DependencyProperty
PreviewOffsetYProperty System.Windows.DependencyProperty
PreviewOpacityProperty System.Windows.DependencyProperty
ShowsPreviewProperty System.Windows.DependencyProperty
SplitterBackgroundProperty System.Windows.DependencyProperty
SplitterDistanceProperty System.Windows.DependencyProperty
SplitterTemplateProperty System.Windows.DependencyProperty
SplitterWidthProperty System.Windows.DependencyProperty

Private Properties

Property Type Description
CalculateLengthes System.Windows.Size
GetChildrenLengthes void
GetMinMaxDelta void
GetOffset Point
GetRects System.Windows.Size
KeyboardMoveSplitter bool
MoveSplitter void
MoveSplitter void
OnChildChanged void
OnChildChanged void
OnSplitterTemplateChanged void
SetSplitterTemplate void
SplitContainer System
ValidateChildMinSize bool
ValidateIncrement bool
ValidateOrientation bool

Protected Methods

Method Description
ArrangeOverride ( Size finalSize ) : Size
GetVisualChild ( int index ) : Visual
MeasureOverride ( Size availableSize ) : Size
OnKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void

Private Methods

Method Description
CalculateLengthes ( Size availableSize, double &child1Length, double &splitterLength, double &child2Length ) : Size
GetChildrenLengthes ( double &child1Length, double &child2Length ) : void
GetMinMaxDelta ( double &minDelta, double &maxDelta ) : void
GetOffset ( double horizontalChange, double verticalChange, double increment ) : Point
GetRects ( Size availableSize, Rect &child1Rect, Rect &splitterRect, Rect &child2Rect ) : Size
KeyboardMoveSplitter ( double deltaX, double deltaY ) : bool
MoveSplitter ( SplitterDistance value ) : void
MoveSplitter ( double offsetX, double offsetY ) : void
OnChildChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnChildChanged ( UIElement oldChild, UIElement newChild ) : void
OnSplitterTemplateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
SetSplitterTemplate ( System.Windows.DataTemplate splitterTemplate ) : void
SplitContainer ( ) : System
ValidateChildMinSize ( object o ) : bool
ValidateIncrement ( object o ) : bool
ValidateOrientation ( object o ) : bool

Method Details

ArrangeOverride() protected method

protected ArrangeOverride ( Size finalSize ) : Size
finalSize System.Windows.Size
return System.Windows.Size

GetVisualChild() protected method

protected GetVisualChild ( int index ) : Visual
index int
return Visual

MeasureOverride() protected method

protected MeasureOverride ( Size availableSize ) : Size
availableSize System.Windows.Size
return System.Windows.Size

OnKeyDown() protected method

protected OnKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs
return void

OnMouseLeftButtonDown() protected method

protected OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs
return void

OnRender() protected method

protected OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void
drawingContext System.Windows.Media.DrawingContext
return void

Property Details

BackgroundProperty public_oe static_oe property

Identifies the Background dependency property.
public static DependencyProperty,System.Windows BackgroundProperty
return System.Windows.DependencyProperty

Child1MinSizeProperty public_oe static_oe property

Identifies the Child1MinSize dependency property.
public static DependencyProperty,System.Windows Child1MinSizeProperty
return System.Windows.DependencyProperty

Child1Property public_oe static_oe property

Identifies the Child1 dependency property.
public static DependencyProperty,System.Windows Child1Property
return System.Windows.DependencyProperty

Child2MinSizeProperty public_oe static_oe property

Identifies the Child2MinSize dependency property.
public static DependencyProperty,System.Windows Child2MinSizeProperty
return System.Windows.DependencyProperty

Child2Property public_oe static_oe property

Identifies the Child2 dependency property.
public static DependencyProperty,System.Windows Child2Property
return System.Windows.DependencyProperty

DragIncrementProperty public_oe static_oe property

Identifies the DragIncrement dependency property.
public static DependencyProperty,System.Windows DragIncrementProperty
return System.Windows.DependencyProperty

IsPreviewVisibleProperty public_oe static_oe property

Identifies the IsPreviewVisible dependency property.
public static DependencyProperty,System.Windows IsPreviewVisibleProperty
return System.Windows.DependencyProperty

IsSplitterTopLeftProperty public_oe static_oe property

Identifies the IsSplitterTopLeft dependency property.
public static DependencyProperty,System.Windows IsSplitterTopLeftProperty
return System.Windows.DependencyProperty

KeyboardIncrementProperty public_oe static_oe property

Identifies the KeyboardIncrement dependency property.
public static DependencyProperty,System.Windows KeyboardIncrementProperty
return System.Windows.DependencyProperty

OrientationProperty public_oe static_oe property

Identifies the Orientation dependency property.
public static DependencyProperty,System.Windows OrientationProperty
return System.Windows.DependencyProperty

PreviewBackgroundProperty public_oe static_oe property

Identifies the PreviewBackground dependency property.
public static DependencyProperty,System.Windows PreviewBackgroundProperty
return System.Windows.DependencyProperty

PreviewOffsetXProperty public_oe static_oe property

Identifies the PreviewOffsetX dependency property.
public static DependencyProperty,System.Windows PreviewOffsetXProperty
return System.Windows.DependencyProperty

PreviewOffsetYProperty public_oe static_oe property

Identifies the PreviewOffsetY dependency property.
public static DependencyProperty,System.Windows PreviewOffsetYProperty
return System.Windows.DependencyProperty

PreviewOpacityProperty public_oe static_oe property

Identifies the PreviewOpacity dependency property.
public static DependencyProperty,System.Windows PreviewOpacityProperty
return System.Windows.DependencyProperty

ShowsPreviewProperty public_oe static_oe property

Identifies the ShowsPreview dependency property.
public static DependencyProperty,System.Windows ShowsPreviewProperty
return System.Windows.DependencyProperty

SplitterBackgroundProperty public_oe static_oe property

Identifies the SplitterBackground dependency property.
public static DependencyProperty,System.Windows SplitterBackgroundProperty
return System.Windows.DependencyProperty

SplitterDistanceProperty public_oe static_oe property

Identifies the SplitterDistance dependency property.
public static DependencyProperty,System.Windows SplitterDistanceProperty
return System.Windows.DependencyProperty

SplitterTemplateProperty public_oe static_oe property

Identifies the SplitterTemplate dependency property.
public static DependencyProperty,System.Windows SplitterTemplateProperty
return System.Windows.DependencyProperty

SplitterWidthProperty public_oe static_oe property

Identifies the SplitterWidth dependency property.
public static DependencyProperty,System.Windows SplitterWidthProperty
return System.Windows.DependencyProperty