Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

UIServiceContainerExtensions.GetRequiredService(IUIServiceContainer, Type, String) Method

Gets the service from the specified IUIServiceContainer. If the requested service is not found, the method throws an exception.

Namespace: DevExpress.Maui.Mvvm

Assembly: DevExpress.Maui.Mvvm.dll

NuGet Package: DevExpress.Maui.Mvvm

#Declaration

C#
public static object GetRequiredService(
    this IUIServiceContainer container,
    Type type,
    string key = null
)

#Parameters

Name Type Description
container IUIServiceContainer

The source container that hosts services.

type Type

The service type.

#Optional Parameters

Name Type Default Description
key String null

The key that identifies the required service instance when multiple services of the same type are registered.

#Returns

Type Description
System.Object

The required service. If the service is not found, the method throws an exception.

See Also