C# Класс 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.

Наследование: System.Windows.FrameworkElement
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Свойство Тип Описание
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

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

ArrangeOverride() защищенный Метод

protected ArrangeOverride ( Size finalSize ) : Size
finalSize System.Windows.Size
Результат System.Windows.Size

GetVisualChild() защищенный Метод

protected GetVisualChild ( int index ) : Visual
index int
Результат Visual

MeasureOverride() защищенный Метод

protected MeasureOverride ( Size availableSize ) : Size
availableSize System.Windows.Size
Результат System.Windows.Size

OnKeyDown() защищенный Метод

protected OnKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs
Результат void

OnMouseLeftButtonDown() защищенный Метод

protected OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs
Результат void

OnRender() защищенный Метод

protected OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void
drawingContext System.Windows.Media.DrawingContext
Результат void

Описание свойств

BackgroundProperty публичное статическое свойство

Identifies the Background dependency property.
public static DependencyProperty,System.Windows BackgroundProperty
Результат System.Windows.DependencyProperty

Child1MinSizeProperty публичное статическое свойство

Identifies the Child1MinSize dependency property.
public static DependencyProperty,System.Windows Child1MinSizeProperty
Результат System.Windows.DependencyProperty

Child1Property публичное статическое свойство

Identifies the Child1 dependency property.
public static DependencyProperty,System.Windows Child1Property
Результат System.Windows.DependencyProperty

Child2MinSizeProperty публичное статическое свойство

Identifies the Child2MinSize dependency property.
public static DependencyProperty,System.Windows Child2MinSizeProperty
Результат System.Windows.DependencyProperty

Child2Property публичное статическое свойство

Identifies the Child2 dependency property.
public static DependencyProperty,System.Windows Child2Property
Результат System.Windows.DependencyProperty

DragIncrementProperty публичное статическое свойство

Identifies the DragIncrement dependency property.
public static DependencyProperty,System.Windows DragIncrementProperty
Результат System.Windows.DependencyProperty

IsPreviewVisibleProperty публичное статическое свойство

Identifies the IsPreviewVisible dependency property.
public static DependencyProperty,System.Windows IsPreviewVisibleProperty
Результат System.Windows.DependencyProperty

IsSplitterTopLeftProperty публичное статическое свойство

Identifies the IsSplitterTopLeft dependency property.
public static DependencyProperty,System.Windows IsSplitterTopLeftProperty
Результат System.Windows.DependencyProperty

KeyboardIncrementProperty публичное статическое свойство

Identifies the KeyboardIncrement dependency property.
public static DependencyProperty,System.Windows KeyboardIncrementProperty
Результат System.Windows.DependencyProperty

OrientationProperty публичное статическое свойство

Identifies the Orientation dependency property.
public static DependencyProperty,System.Windows OrientationProperty
Результат System.Windows.DependencyProperty

PreviewBackgroundProperty публичное статическое свойство

Identifies the PreviewBackground dependency property.
public static DependencyProperty,System.Windows PreviewBackgroundProperty
Результат System.Windows.DependencyProperty

PreviewOffsetXProperty публичное статическое свойство

Identifies the PreviewOffsetX dependency property.
public static DependencyProperty,System.Windows PreviewOffsetXProperty
Результат System.Windows.DependencyProperty

PreviewOffsetYProperty публичное статическое свойство

Identifies the PreviewOffsetY dependency property.
public static DependencyProperty,System.Windows PreviewOffsetYProperty
Результат System.Windows.DependencyProperty

PreviewOpacityProperty публичное статическое свойство

Identifies the PreviewOpacity dependency property.
public static DependencyProperty,System.Windows PreviewOpacityProperty
Результат System.Windows.DependencyProperty

ShowsPreviewProperty публичное статическое свойство

Identifies the ShowsPreview dependency property.
public static DependencyProperty,System.Windows ShowsPreviewProperty
Результат System.Windows.DependencyProperty

SplitterBackgroundProperty публичное статическое свойство

Identifies the SplitterBackground dependency property.
public static DependencyProperty,System.Windows SplitterBackgroundProperty
Результат System.Windows.DependencyProperty

SplitterDistanceProperty публичное статическое свойство

Identifies the SplitterDistance dependency property.
public static DependencyProperty,System.Windows SplitterDistanceProperty
Результат System.Windows.DependencyProperty

SplitterTemplateProperty публичное статическое свойство

Identifies the SplitterTemplate dependency property.
public static DependencyProperty,System.Windows SplitterTemplateProperty
Результат System.Windows.DependencyProperty

SplitterWidthProperty публичное статическое свойство

Identifies the SplitterWidth dependency property.
public static DependencyProperty,System.Windows SplitterWidthProperty
Результат System.Windows.DependencyProperty