DesktopWindowServices class

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

public sealed class DesktopWindowServices : IAsyncDisposable

Inherits or implements IAsyncDisposable.

The per-window services DesktopPlatformServices.AttachWindowServices attached to a DesktopWindow the application opened itself.

Remarks

The binding ends when the window closes or when it is disposed: the presentation then reports PlatformUnavailableReason.OwnerClosed and RunicWindowActivity.Closed, the locale and the appearance no longer reach the window, the platform services stop, and IRunicWindowContext.RequestCloseAsync throws. A scope cannot be attached again; a new window takes a new scope. Disposing it never closes the window and never disposes the scope or the content session.

Properties

NativeOwner

public DesktopNativeOwner NativeOwner { get; }

Gets the window's native owner, which the platform services are bound to.

Presentation

public IRunicWindowPresentation Presentation { get; }

Gets the window's presentation: the scope's own IRunicWindowPresentation, which its ViewModels hold, or, for a scope without AddRunicWindowService(), one of this binding.

Window

public DesktopWindow Window { get; }

Gets the window the services were attached to.

Methods

DisposeAsync

public ValueTask DisposeAsync()

Detaches the services from the window early, as its close does.

Returns

A task that completes when the platform services stopped.