public interface IBridgeWindow : IAsyncDisposable The lifetime contract shared by every Window host adapter, such as CsWebUiBridgeWindow<TViewModel> and DesktopBridgeWindow<TViewModel>. RunicWindow.Host returns the adapter of an open Window.
Remarks
Hosts release asynchronously: accepted operations may still be running when the visible window closes, and the Window's DI scope stays alive until they finish. IAsyncDisposable.DisposeAsync closes immediately and returns after every resource has been released.
Methods
CloseAsync
ValueTask<RunicWindowCloseResult> CloseAsync(TimeSpan timeout, CancellationToken cancellationToken = default) Stops new operation admission and waits up to timeout for accepted work. At the timeout the visible window and its browser routes close promptly, while the host keeps its scope until the remaining operations finish. The first call selects the timeout; later calls return the same result.
Parameters
timeoutHow long accepted operations may run before the window closes anyway.
cancellationTokenStops this caller's wait. The close itself continues, and other callers still receive its result.
Exceptions
ArgumentOutOfRangeExceptiontimeoutis negative and not infinite.OperationCanceledExceptioncancellationTokenwas cancelled.
WaitForCloseAsync
ValueTask WaitForCloseAsync(CancellationToken cancellationToken = default) Completes when the window closes: the user closed it, or IBridgeWindow.CloseAsync or IAsyncDisposable.DisposeAsync started closing it. It does not release the window; dispose it afterwards.
Parameters
cancellationTokenStops the wait without closing the window.
Exceptions
OperationCanceledExceptioncancellationTokenwas cancelled.