Glossary

On this page

Each of these words names one concept across the Runic packages, the generated clients and these guides. The first seven follow the glossary of the Runic.Application.Views package guide.

Windows and Views #

  • Window: a top-level application window and its root ViewModel, declared as a partial RunicWindow<TViewModel>. The same declaration opens on every host with host.OpenWindowAsync<TWindow>(), with ReactiveUI or CommunityToolkit.Mvvm ViewModels. A Window is also a View. Runic Desktop's DesktopWindow is the native window underneath one.
  • View: a logical .NET presentation object for one ViewModel, a partial RunicView<TViewModel> (ReactiveRunicView<TViewModel> with ReactiveUI) with a typed DataContext. It owns no DOM: the frontend renders a component for it. The browser opens and closes a presentation of each View it shows, so a fresh View is created when a component mounts and released when it unmounts, while the ViewModel stays.
  • ViewModel content: a ViewModel-typed property, such as the template's Main, whose value the frontend receives as a reference (for example a CounterPageReference) rather than as state. Changing the property changes the page.
  • ViewOutlet: the component that renders the View for a ViewModel content reference, in React, Vue, Svelte and Angular. A ViewRegistry maps each kind of reference to a component, and the compiler checks that every kind has one. Since SDK 0.11.0, its optional missing replaces the English alert shown for a kind without a component.
  • Generated client: the TypeScript module the build writes for each ViewModel to Frontend/src/generated, such as counter.ts with CounterState and CounterClient. It is regenerated on every build and not committed.
  • Bridge: the code generated per ViewModel, C# and its TypeScript client, that carries state, property writes, commands and operations between the ViewModel and its View over Views protocol 4 (since SDK 0.13.0). Bridge* types and the RUNICBRIDGE diagnostics belong to this generated layer.
  • View request: since SDK 0.16.0, a get-only ViewRequest<T> that a ViewModel raises to ask its page for a presentation action, such as focusing a field, without an answer. See ask the page to act.
  • View question: since SDK 0.16.0, a ViewQuestion<TInput, TOutput> that any ViewModel asks its page with AskAsync and whose answer it awaits, with an optional .NET fallback. See ask the page and await its answer.

Hosts and windows #

  • Host: the adapter that opens Windows on a platform: RunicDesktopHost (Runic.Application.Views.Desktop) and RunicCsWebUiHost (Runic.Application.Views.CsWebUi), both an IRunicWindowHost. In WPF, RunicViewHost hosts one View inside the visual tree. An open Window's Host property returns its per-Window adapter, an IBridgeWindow. Choosing a host and MVVM library compares the hosts.
  • Window service: IRunicWindowService, registered with AddRunicWindowService(), opens another Window from a ViewModel or service, in its own DI scope on the host that runs the application; see opening a Window from a ViewModel.
  • Owned Window: since SDK 0.16.0, a Window opened with RunicWindowOptions.Owner; it hides and shows with its owner, and with Modality = RunicWindowModality.Window it blocks the owner until it closes. See owned and window-modal Windows.
  • Connection: one page connected to a Window. Since SDK 0.16.0 each has a key that no later connection of the Window reuses, and IRunicConnections lists them and names the Caller of the running command. Keys tell pages apart; they are not user identity. See who is connected.
  • Presentation: what shows a Window's or View's web content on screen: an embedded WebView or an installed browser window, such as DesktopBridgeWindow.Window (a DesktopWindow). A presentation closes and reopens without changing the ViewModel.
  • Presentation epoch: since SDK 0.15.0, a number for what a route's page shows. A new epoch begins with the route's first state and with each RunicPresentation.Renew; a [RunicPresentationScoped] command sent for an earlier epoch does not run. See commands scoped to their page.
  • Presentation server: the loopback server that serves a Runic Desktop Window's page: the native server (Runic.Desktop.NativeServer) or ASP.NET Core Kestrel (Runic.Desktop.Kestrel), since SDK 0.15.0 a package of its own. See the presentation server.
  • Surface: Runic Desktop's DesktopSurface, which serves a Window's web content, capabilities and browser sessions, and opens presentations of it. DesktopBridgeWindow.Surface is the Window's surface.
  • Owner: the native window that platform services, such as file dialogs, the clipboard and file launchers, attach to: DesktopNativeOwner for a Runic Desktop window, or an INativeWindowOwner for another host. With AddRunicPlatformServices(), the services a ViewModel takes in its constructor bind to the Window's owner when it opens.
  • Menu bar: the menus a host declares, DesktopHostOptions.MenuBar on Runic Desktop or RunicCsWebUiHostOptions.MenuBar on CS-WebUI. Since SDK 0.11.0 Runic Desktop shows it natively by default, and a page can render it with its own components through useMenuBar() (React, Vue, Svelte) or injectMenuBar() (Angular); Runic ships no menubar component.

State and threads #

  • Model context: the IRunicModelContext that a Window's ViewModels belong to. It runs their changes one at a time, as a UI thread does, so ViewModels need no locks. The host gives each Window the context of its DI scope; with WPF it is the UI dispatcher (DispatcherModelContext).
  • Turn: one short, synchronous unit of work on a model context. The Bridge reads state, applies property writes and starts commands in turns. An await in a command resumes in a later turn of the same context, so setting state after await is correct; see ViewModel state and threads.
  • Query collection: since SDK 0.16.0, a RunicQueryCollection<TRow, TKey> whose rows stay in .NET, such as a database table; each page loads only the range it shows. See query collections.
  • Blob and upload: since SDK 0.16.0, RunicBlob sends binary content to the page as a URL of its Window, and RunicUpload is a file the page streamed to the Window's host. See blobs and uploads.
  • Edit session: since SDK 0.16.0, a RunicEditSession<T> that keeps a form's saved baseline and reports IsDirty. See forms and edit sessions.
  • Region: a NavigationRegion<TContent> from Runic.Navigation, a navigable place in a Window, such as the main page or a dialog, with Back history, departure guards and owned content. Exposed as a get-only property, it is a content slot like any ViewModel content. See pages and navigation.
  • Selection: a NavigationSelection, since SDK 0.12.0, that chooses which of a page's sibling regions is presented, such as tabs that each keep their own stack. Switching is a guarded transition that asks the tab left; in Runic Views its SelectedIndex is state, not a content slot. See tabs that keep their own pages.
  • Region collection: since SDK 0.16.0, a NavigationSelection marked [RunicRegionCollection] whose regions open and close at run time, such as document tabs. See document tabs.
  • Route and navigation path: since SDK 0.16.0, a route maps a path such as customers/42 to a navigation target, and a NavigationPath saves a Window's navigation to rebuild it later or show it in the URL. See save and restore navigation.
  • Entry: one visit in a region's history. A borrowed entry presents a ViewModel that someone else owns, such as the Window's scope; an owned entry's ViewModel belongs to the entry, usually created for the visit, and is disposed when the entry retires.
  • Entry context: the NavigationEntryContext of one entry, with its id, state and the operations it performs on itself, such as completing with a result or going back. A ViewModel that the navigator constructs takes it as a constructor parameter; one you create yourself receives it in INavigationInitialize. The container never resolves it.
  • Navigated to and from: an entry becoming its region's current entry, on its first commit and after every Back to it, and stopping being current. INavigationAware, or entry.WhenNavigatedTo with ReactiveUI, reports both. Unlike ReactiveUI activation, which follows a mounted View, they follow the entry.
  • Departure guard: an INavigationDepartureGuard ViewModel that can refuse to be left, for example while it has unsaved changes. A leave confirmation, ReactiveLeaveConfirmation.WithInteraction or LeaveConfirmation.InDialog, asks the user; when nothing answers, the departure fails and the page stays.
  • Result: the value an entry pushed with PushForResult ends with. Completion is Completed with the value, or Dismissed on every other path.
  • Close guard: a Window with GuardClose asks CanCloseAsync, by default the departure guards of its regions, before the user closes it. RequestCloseAsync() asks the same way from code. CS-WebUI and browser windows can't stay open, so they open unguarded with warning 1053.