RunicWindowServiceExtensions class

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

public static class RunicWindowServiceExtensions

Observes IRunicWindowService.Windows without System.Reactive.

Methods

ObserveWindows

public static IObservable<IReadOnlyList<IRunicWindow>> ObserveWindows(this IRunicWindowService windows)

The open Windows now and after every change: a plain IObservable over IRunicWindowService.WindowsChanged that ReactiveUI composes and CommunityToolkit can subscribe to.

Remarks

A subscription receives the list at once, on the subscribing thread, then the list after each change, one at a time and in order, on a thread-pool thread. Each list is its own. A ViewModel posts what it does with them to its own model context, or uses the overload that takes it. Dispose the subscription to stop.

ObserveWindows

public static IObservable<IReadOnlyList<IRunicWindow>> ObserveWindows(this IRunicWindowService windows, IRunicModelContext context)

The open Windows now and after every change, as RunicWindowServiceExtensions.ObserveWindows, delivered in turns of context, such as the model context of the ViewModel that subscribes.

Remarks

_windowList = windows.ObserveWindows(context).Subscribe(list => OpenCount = list.Count);

Every list, the first one included, is posted with IRunicModelContext.TryPost, in order; lists that arrive after the context closed are dropped.