Vixen
dd8b0a81
csharp
public sealed class SplitView

Two panes with a bar between them that resizes both.

Read the guide page for this →

Remarks

⚠ This existed and could not be reached. A draggable two-pane divider was written once, welded inside DockingHost as DockSplitterView, so an application that wanted a sidebar beside a document had to adopt the whole docking model — a layout tree, panel identities, tab groups, a save format and drag-and-drop between groups — to get one bar it could pull. NavigationSplitView and NSSplitView are the shape half of desktop applications start from, and starting from a docking host is not the same offer.

The ratio is flex-grow and a drag writes two declarations. No rebuild, no reparent, no measurement pass of its own — which is DockSplitterView's arrangement and its reasons, kept because they are the reasons a splitter feels attached to the pointer.

⚠ flex-basis: 0px on both panes is the half that looks redundant and is not. With the default auto basis flexbox shares out only what is left after the contents have been measured, so two panes at 50/50 come out at whatever their contents wanted plus half the remainder each — and a bar dragged to the middle does not land in the middle.

Not a docking host and deliberately not on the way to being one. There is no tab group, no drag between panes and no saved layout: an application that wants those wants DockingHost, and one that wants a sidebar should not have to explain why it does not.

Fields and properties (14)

  • public const string SecondSlot

    The name markup writes to reach Second.

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • protected override AccessibleRole NativeRole
  • public UiElement First

    The near pane: the left one, or the top one.

  • public UiElement Bar

    The bar between them.

  • public UiElement Second

    The far pane: the right one, or the bottom one.

  • protected override UiElement ContentHost
  • public Orientation Orientation
  • public float Ratio
  • public float MinimumRatio
  • public static readonly UiPropertyKey OrientationProperty

    Identity for Orientation.

  • public static readonly UiPropertyKey RatioProperty

    Identity for Ratio.

  • public static readonly UiPropertyKey MinimumRatioProperty

    Identity for MinimumRatio.

Events (1)

  • public Action<SplitView, float>? RatioChanged

    Raised while the bar is dragged, and once when it is let go.

Methods (7)

  • protected override UiElement? NamedHost(string name)
  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • protected override void OnPropertyChanged(UiPropertyKey key)
  • public void Apply()

    Writes the ratio onto the two panes.

  • public void ClearOrientation()

    Unsets Orientation, so it takes its default or its ancestor's value again.

  • public void ClearRatio()

    Unsets Ratio, so it takes its default or its ancestor's value again.

  • public void ClearMinimumRatio()

    Unsets MinimumRatio, so it takes its default or its ancestor's value again.

Used by (3)

  • GalleryHelloUi
  • AccessibleNameLocalisationTestsVixen.Ui.Controls.Tests
  • SplitViewTestsVixen.Ui.Controls.Tests