IRunicWindowParameter<TParameter> interface

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

public interface IRunicWindowParameter<out TParameter> where TParameter : class

The parameter that RunicWindowHostExtensions.OpenWindowAsync or IRunicWindowService.OpenWindowAsync handed to the Window whose scope resolves it. Take it in the constructor of the Window's ViewModel, or of a scoped service the ViewModel uses.

Type parameters

TParameter

The parameter's type, as the open named it.

Remarks

RunicWindowServiceCollectionExtensions.AddRunicWindowService registers it per scope. In a test, pass a RunicWindowParameter to a ViewModel built by hand.

Properties

Value

TParameter Value { get; }

The parameter the Window was opened with.

Exceptions

InvalidOperationException

The Window was opened without a parameter of this type, or the service was resolved outside a Window's scope.