ServiceContainer.GetService<T>(ServiceSearchMode) Method

Performs a search for a service implementing the specified service interface.

Namespace: DevExpress.Mvvm

Assembly: DevExpress.Mvvm.v20.2.dll

Declaration

public T GetService<T>(
    ServiceSearchMode searchMode = ServiceSearchMode.PreferLocal
)
    where T : class
Public Function GetService(Of T As Class)(
    searchMode As ServiceSearchMode = ServiceSearchMode.PreferLocal
) As T

Optional Parameters

Name Type Default Description
searchMode ServiceSearchMode

0

A ServiceSearchMode enumeration value.

Type Parameters

Name
T

Returns

Type Description
T

An object implementing the specified service interface.

Remarks

To learn more, see Services in custom ViewModels.

See Also