Class SplitPane
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
An abstract base class for split pane containers that divide space between child widgets with moveable splitter handles.
public abstract class SplitPane : Container, IItemWithId, INotifyAttachedPropertyChanged, IContainer
- Inheritance
-
SplitPane
- Implements
- Derived
- Inherited Members
Constructors
SplitPane(Stylesheet, string)
Initializes a new instance of the SplitPane class with the specified stylesheet and style.
protected SplitPane(Stylesheet stylesheet, string styleName)
Parameters
stylesheetStylesheetThe stylesheet to use for applying the style.
styleNamestringThe name of the style to apply to the split pane.
SplitPane(string)
Initializes a new instance of the SplitPane class.
protected SplitPane(string styleName)
Parameters
styleNamestringThe name of the style to apply to the split pane.
Properties
HandleStyle
Gets or sets the style applied to the splitter handle buttons.
[Browsable(false)]
public SplitPanelButtonStyle HandleStyle { get; }
Property Value
Orientation
Gets the orientation (horizontal or vertical) of the split pane.
[Browsable(false)]
public abstract Orientation Orientation { get; }
Property Value
Widgets
Gets the collection of child widgets in the split pane.
[Browsable(false)]
public override IList<Widget> Widgets { get; }
Property Value
Methods
ApplyStyle(WidgetStyle)
Applies the specified widget style to this split pane.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
CopyFrom(Widget)
Copies the style and properties from another split pane.
protected override void CopyFrom(Widget w)
Parameters
wWidgetThe source split pane to copy from.
GetProportion(int)
Gets the proportion (size ratio) of the widget at the specified index.
public float GetProportion(int widgetIndex)
Parameters
widgetIndexintThe index of the widget.
Returns
- float
The proportion value, or 0 if the index is out of range.
GetSplitterPosition(int)
Gets the position of the splitter between two widgets as a proportion (0.0 to 1.0).
public float GetSplitterPosition(int leftWidgetIndex)
Parameters
leftWidgetIndexintThe index of the widget to the left/top of the splitter.
Returns
- float
The splitter position as a proportion of total space.
OnTouchMoved()
Handles touch/mouse movement for dragging splitter handles to resize sections.
public override void OnTouchMoved()
Reset()
Reinitializes the split pane layout based on the current widgets and handle style.
public void Reset()
SetSplitterPosition(int, float)
Sets the position of the splitter between two widgets.
public void SetSplitterPosition(int leftWidgetIndex, float proportion)
Parameters
leftWidgetIndexintThe index of the widget to the left/top of the splitter.
proportionfloatThe splitter position as a proportion (0.0 to 1.0).
Events
ProportionsChanged
Occurs when the splitter positions change.
public event MyraEventHandler ProportionsChanged