Glossary
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 withhost.OpenWindowAsync<TWindow>(), with ReactiveUI or CommunityToolkit.Mvvm ViewModels. A Window is also a View. Runic Desktop'sDesktopWindowis the native window underneath one. - View: a logical .NET presentation object for one ViewModel, a partial
RunicView<TViewModel>(ReactiveRunicView<TViewModel>with ReactiveUI) with a typedDataContext. 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 aCounterPageReference) 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. AViewRegistrymaps each kind of reference to a component, and the compiler checks that every kind has one. Since SDK0.11.0, its optionalmissingreplaces 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 ascounter.tswithCounterStateandCounterClient. 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 theRUNICBRIDGEdiagnostics belong to this generated layer. - View request: since SDK
0.16.0, a get-onlyViewRequest<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, aViewQuestion<TInput, TOutput>that any ViewModel asks its page withAskAsyncand 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) andRunicCsWebUiHost(Runic.Application.Views.CsWebUi), both anIRunicWindowHost. In WPF,RunicViewHosthosts one View inside the visual tree. An open Window'sHostproperty returns its per-Window adapter, anIBridgeWindow. Choosing a host and MVVM library compares the hosts. - Window service:
IRunicWindowService, registered withAddRunicWindowService(), 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 withRunicWindowOptions.Owner; it hides and shows with its owner, and withModality = RunicWindowModality.Windowit blocks the owner until it closes. See owned and window-modal Windows. - Connection: one page connected to a Window. Since SDK
0.16.0each has a key that no later connection of the Window reuses, andIRunicConnectionslists them and names theCallerof 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(aDesktopWindow). 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 eachRunicPresentation.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 SDK0.15.0a 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.Surfaceis the Window's surface. - Owner: the native window that platform services, such as file dialogs,
the clipboard and file launchers, attach to:
DesktopNativeOwnerfor a Runic Desktop window, or anINativeWindowOwnerfor another host. WithAddRunicPlatformServices(), 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.MenuBaron Runic Desktop orRunicCsWebUiHostOptions.MenuBaron CS-WebUI. Since SDK0.11.0Runic Desktop shows it natively by default, and a page can render it with its own components throughuseMenuBar()(React, Vue, Svelte) orinjectMenuBar()(Angular); Runic ships no menubar component.
State and threads #
- Model context: the
IRunicModelContextthat 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
awaitin a command resumes in a later turn of the same context, so setting state afterawaitis correct; see ViewModel state and threads. - Query collection: since SDK
0.16.0, aRunicQueryCollection<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,RunicBlobsends binary content to the page as a URL of its Window, andRunicUploadis a file the page streamed to the Window's host. See blobs and uploads. - Edit session: since SDK
0.16.0, aRunicEditSession<T>that keeps a form's saved baseline and reportsIsDirty. See forms and edit sessions.
Navigation #
- Region: a
NavigationRegion<TContent>fromRunic.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 SDK0.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 itsSelectedIndexis state, not a content slot. See tabs that keep their own pages. - Region collection: since SDK
0.16.0, aNavigationSelectionmarked[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 ascustomers/42to a navigation target, and aNavigationPathsaves 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
NavigationEntryContextof 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 inINavigationInitialize. 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, orentry.WhenNavigatedTowith ReactiveUI, reports both. Unlike ReactiveUI activation, which follows a mounted View, they follow the entry. - Departure guard: an
INavigationDepartureGuardViewModel that can refuse to be left, for example while it has unsaved changes. A leave confirmation,ReactiveLeaveConfirmation.WithInteractionorLeaveConfirmation.InDialog, asks the user; when nothing answers, the departure fails and the page stays. - Result: the value an entry pushed with
PushForResultends with.CompletionisCompletedwith the value, orDismissedon every other path. - Close guard: a Window with
GuardCloseasksCanCloseAsync, 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.