Skip to content

ApplicationServicesContext.GetRequiredService<T> method

Returns the service, throwing InvalidOperationException when it is missing.

Namespace: Eremex.AvaloniaUI.Controls.ApplicationServices
Assembly: Eremex.Avalonia.Controls.ApplicationServices.dll
NuGet Package: Eremex.Avalonia.Controls.ApplicationServices

Declaration

public static T GetRequiredService<T>()
    where T : class

Type Parameters

name description
T The service type to resolve, normally an interface.

Returns

type description
T The registered service instance. Never null.

Exceptions

exception condition
InvalidOperationException Current has not been set, or the service is not registered.

See Also