Vixen
02b45cc4
csharp
public sealed class Expander

A header, and content that appears when it is pressed.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Collapsed means display: none, not removed. The content keeps its state, its scroll offset and its focus history across an open-and-shut, which is what an inspector section has to do — and it means expanding is a restyle rather than a rebuild. The cost is that a collapsed section's elements exist; an application with a genuinely expensive one should build it on first expansion, which Expanded is for.

⚠ The chevron is swapped, not rotated. This class used to say the stylesheet turned it — expander.open expander-header icon — and both halves of that were wrong: no such rule was ever written, and there is no transform in the style engine to write it with. So an expander opened and closed with the arrow pointing right the whole time, which is the one affordance saying whether there is anything inside. Swapping the geometry is what TreeView and the code editor's fold gutter already do.

Fields and properties (7)

  • 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.

  • public ExpanderHeader Header

    The strip that opens it.

  • public UiElement Content

    Where the content goes.

  • public string? Label

    What the header says.

  • public bool IsExpanded
  • public static readonly UiPropertyKey IsExpandedProperty

    Identity for IsExpanded.

Events (1)

  • public Action<Expander, bool>? Expanded

    Raised when it opens or closes.

Methods (2)

  • protected override void OnCreated()

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

  • public void ClearIsExpanded()

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

Used by (19)

  • ShellHelloUi
  • AccordionVixen.Ui.Controls
  • ControlVisualTestsVixen.Ui.Controls.Tests
  • NavigationInteractionTestsVixen.Ui.Controls.Tests
  • PropertyGridVixen.Ui.Controls.Advanced
  • SelectionTestsVixen.Ui.Controls.Tests
  • BehaviorAuthoringTestsVixen.Editor.App.Tests
  • BrushInspectorMarkupTestsVixen.Editor.Terrain.Tests
  • ComponentTestsVixen.Editor.App.Tests
  • ComponentsViewVixen.Editor.App
  • CompositeEditorVixen.Editor.Inspector
  • EditorAffordanceTestsVixen.Editor.App.Tests
  • ImportSettingsViewVixen.Editor.AssetEditors
  • InspectorPanelTestsVixen.Editor.App.Tests
  • InspectorViewVixen.Editor.Inspector
  • ListDrawerVixen.Editor.Inspector
  • MaterialViewVixen.Editor.AssetEditors
  • NestedDrawerVixen.Editor.Inspector
  • TerrainBrushInspectorVixen.Editor.Terrain