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 acknowledges each mount, 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.- 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 snapshots, property writes, commands and operations between the
ViewModel and its View over the wire protocol.
Bridge*types and theRUNICBRIDGEdiagnostics belong to this generated layer.
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. - Presentation: what shows a Window's or View's web content on screen: an
embedded WebView or an installed browser window, such as
DesktopBridgeWindow.Presentation(aDesktopWindow). A presentation closes and reopens without changing the ViewModel. - 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 anINativePickerOwnerfor another host. WithAddRunicPlatformServices(), the services a ViewModel takes in its constructor bind to the Window's owner when it opens.
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.
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. - 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.