Back to Devexpress

UIServiceContainerExtensions.GetService<T>(IUIServiceContainer, String) Method

maui-devexpress-dot-maui-dot-mvvm-dot-uiservicecontainerextensions-dot-getservice-1-x28-devexpress-dot-maui-dot-mvvm-dot-iuiservicecontainer-system-dot-string-x29.md

latest1.5 KB
Original Source

UIServiceContainerExtensions.GetService<T>(IUIServiceContainer, String) Method

Gets the service from the specified IUIServiceContainer.

Namespace : DevExpress.Maui.Mvvm

Assembly : DevExpress.Maui.Mvvm.dll

NuGet Package : DevExpress.Maui.Mvvm

Declaration

csharp
public static T GetService<T>(
    this IUIServiceContainer container,
    string key = null
)
    where T : class

Parameters

NameTypeDescription
containerIUIServiceContainer

The source container that hosts services.

|

Optional Parameters

NameTypeDefaultDescription
keyStringnull

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

|

Type Parameters

NameDescription
T

The service type.

|

Returns

TypeDescription
T

The requested service as the object of the T type.

|

See Also

UIServiceContainerExtensions Class

UIServiceContainerExtensions Members

DevExpress.Maui.Mvvm Namespace