Vixen
dd8b0a81
csharp
public static class DocumentCommands

The command ids a document answers, and the one call that makes an element answer them.

Read the guide page for this →

Remarks

⚠ Answered through the command route rather than by a service, which is the whole point of putting them here. An application with two documents open in two panels has two answers to ⌘S, and the right one is decided by where the focus is — the route already walks focus → parents → root and picks the nearest handler, so a panel that hosts a document registers these and nothing else has to know how many panels there are. A save routed to "the application's document" is the bug this shape does not have.

Fields and properties (2)

  • public const string Save

    Write the nearest document out.

  • public const string Revert

    Throw the nearest document's changes away.

Methods (1)

  • public static void Install(UiElement element)

    Makes an element answer Save and Revert for the document it hosts.

Used by (3)

  • ShellHelloUi
  • DerivedDirtyStateTestsVixen.Ui.Tests
  • EditableDocumentTestsVixen.Ui.Tests