CsWebUiBridgeWindowExtensions class

Namespace Runic.Application.Views.CsWebUi · Runic.Application.CsWebUi 0.7.0-preview.5

public static class CsWebUiBridgeWindowExtensions

Opens CS-WebUI Bridge windows from a service provider.

Methods

OpenWindow

public static TWindow OpenWindow<TWindow, TViewModel>(this IServiceProvider services, Func<CsWebUiBridgeWindow<TViewModel>, TWindow> createWindow) where TWindow : RunicWindow<TViewModel>, IAsyncDisposable where TViewModel : class

Creates the application Window in a new scope before attaching its generated ViewModel Bridge. The Window owns the host adapter lifetime.

Exceptions

CsWebUiConfigurationException

No generated Bridge is registered for TViewModel (CsWebUiConfigurationException.BridgeNotRegisteredCode). The check runs before the native window is created.

ValidateWindow

public static void ValidateWindow<TViewModel>(this IServiceProvider services) where TViewModel : class

Checks at startup, before any window opens, that services can open a Window for TViewModel: its generated Bridge must be registered.

Exceptions

CsWebUiConfigurationException

No generated Bridge is registered (CsWebUiConfigurationException.BridgeNotRegisteredCode).

Remarks

Unlike ValidateDesktopWindow in Runic.Application.Desktop, which returns a DesktopValidationResult, this method returns nothing and throws on the first failure: the Bridge registration is the only check, and it always fails the Window. The check asks the container through IServiceProviderIsService and constructs nothing. A container without that service is not checked here; CsWebUiBridgeWindowExtensions.OpenWindow still reports a missing Bridge before it creates the native window. A failure is logged through the provider's ILoggerFactory (event 1050).