WindowContentSessionOptions class

Namespace Runic.Application.Views in Runic.Application.Views 0.23.0

public sealed class WindowContentSessionOptions

Configures a WindowContentSession.

Constructors

WindowContentSessionOptions

public WindowContentSessionOptions()

No documentation.

Fields

DefaultMaximumInputBytes

public const int DefaultMaximumInputBytes = 1048576

Properties

CreateId

public Func<string>? CreateId { get; init; }

Creates the ids of content references (route content{id}) and interaction requests. Each id must be unique within the session and contain only ASCII letters and digits. Defaults to random GUIDs; tests pass a sequence for stable routes.

FlowCultureFromLocale

public bool FlowCultureFromLocale { get; init; }

Whether the window's bridged invocations run with CultureInfo.CurrentCulture and CultureInfo.CurrentUICulture of the window's WindowContentSession.Locale: the setters, checked writes, commands, validation and state reads of the page's requests, the navigation they start, the window's menu commands, and the close guard when the user closes the window. false, the default, keeps the process's cultures.

Remarks

The cultures flow with the invocation's asynchronous work, through its awaits, and are restored after it. A locale without a predefined .NET culture uses its nearest parent's (de-CH then de), and the process's cultures without one, as with invariant globalization. Code started outside an invocation, such as a timer created at start, keeps the cultures it has. The session reads the value once, when it is created.

Work started inside an invocation captures its culture for its whole life: a timer, a background loop, or a service created lazily on its first resolution in a command keeps formatting in that window's culture, also for other windows and after the locale changed. Start it outside the invocation, or within using (ExecutionContext.SuppressFlow()).

IncludeFailureDetail

public bool? IncludeFailureDetail { get; init; }

Whether this window's Bridge error replies carry the exception type, message and stack, which the TypeScript runtime exposes as BridgeError.detail and the Vite plugin shows in DevTools. null, the default, includes them only when the host environment is Development: DOTNET_ENVIRONMENT, or else ASPNETCORE_ENVIRONMENT, which dotnet runic dev sets. Detail can contain file paths and application data. The session reads the value once, when it is created.

LoggerFactory

public ILoggerFactory? LoggerFactory { get; init; }

Creates the loggers of this window's Bridges, operations and mounts.

MaximumInputBytes

public int? MaximumInputBytes { get; init; }

The largest Bridge input, in UTF-8 bytes, that this window decodes: a setter value, a command argument, a checked write, an operation start, and an interaction request or reply. A larger one is answered as invalid input (rejected with reason invalid-input, or the interaction routes' invalid-request) and does not reach the model. null, the default, is WindowContentSessionOptions.DefaultMaximumInputBytes (1 MiB). A value must be between 1 KiB (1 024) and 64 MiB (67 108 864); the session throws ArgumentOutOfRangeException for another one. The session reads the value once, when it is created.

MaximumPendingUploadBytes

public long? MaximumPendingUploadBytes { get; init; }

The most bytes that uploads which no command claimed yet may take in this window at once (feature blobs/1). An upload beyond it is refused with HTTP 507. null, the default, is 1 GiB. A value must be at least 1 KiB (1 024); the session throws ArgumentOutOfRangeException for another one.

MaximumUploadBytes

public long? MaximumUploadBytes { get; init; }

The largest file, in bytes, that the page may upload to this window (feature blobs/1, RunicUpload). A larger upload is refused while it streams, with HTTP 413. null, the default, is 256 MiB. A value must be at least 1 KiB (1 024); the session throws ArgumentOutOfRangeException for another one. Uploads never cross as Bridge input, so WindowContentSessionOptions.MaximumInputBytes does not limit them.

ModelContext

public IRunicModelContext? ModelContext { get; init; }

An application-owned context, such as the scoped DI context, that the window graph must share. See the WindowContentSession constructor.

OperationShutdown

public CancellationToken OperationShutdown { get; init; }

Cancels window-owned operations when signalled, except those declared RunicOperationClose.Durable.

RootModel

public object? RootModel { get; init; }

The window's root ViewModel, if any.

TimeProvider

public TimeProvider? TimeProvider { get; init; }

The clock of interaction deadlines and close timeouts. Defaults to TimeProvider.System; tests pass a fake clock.

Validation

public RunicValidationOptions? Validation { get; init; }

How this window's Bridges write validation, such as RunicValidationOptions.TextFor for the messages of validation attributes; null, the default, writes the messages as they are. The Desktop, WPF, CS-WebUI and test hosts set it to the RunicValidationOptions of the window's services.

ViewLocator

public IRunicViewLocator? ViewLocator { get; init; }

Resolves .NET Views for presented content.