Vixen
02b45cc4
csharp
public sealed class Dialog

A panel over the whole window that has to be dealt with before anything else.

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

Remarks

Modality is three separate things and a control that does two of them is broken. The backdrop stops the pointer reaching what is behind — a real element covering the viewport, not a colour. IsFocusScope stops Tab walking out into the window behind, which is the half that pointer-only implementations forget. And the focus is moved into the dialog when it opens and put back where it was when it closes, which is the half that everyone forgets.

⚠ The focus is restored to whatever had it, not to whatever opened it. Those are usually the same element and are not always: a dialog opened by a keyboard shortcut was opened by nothing at all. Remembering the focus is the version that works in both cases.

Fields and properties (9)

  • protected override string TagName

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

  • public UiElement Backdrop

    The sheet that covers what is behind.

  • public UiElement Surface

    The dialog's own box, inside the backdrop.

  • public UiElement Header

    The strip at the top.

  • public UiElement Body

    Where the content goes.

  • public UiElement Footer

    Where the buttons go.

  • public IconButton CloseButton

    The close button in the header.

  • public string? Title

    The heading.

  • public UiElement TitlePart

    The heading's element.

Methods (3)

  • protected override void OnCreated()

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

  • protected override void OnOpened()
  • protected override void OnClosed(CloseReason reason)

    Called after it closes.

Used by (9)

  • ControlVisualTestsVixen.Ui.Controls.Tests
  • OverlayInteractionTestsVixen.Ui.Controls.Tests
  • SurfaceTestsVixen.Ui.Controls.Tests
  • AssetPickerTestsVixen.Editor.App.Tests
  • ClosingTestsVixen.Editor.App.Tests
  • DialogServiceVixen.Editor.Ui
  • DialogSessionVixen.Editor.Ui
  • DialogTestsVixen.Editor.Ui.Tests
  • ScenarioTestsVixen.Editor.App.Tests