ServiceContainer.GetService<T>(String, ServiceSearchMode) Method
Performs a search for a service implementing the specified service interface with a specified key.
Namespace: DevExpress.Mvvm
Assembly: DevExpress.Mvvm.v24.2.dll
NuGet Packages: DevExpress.Mvvm, DevExpress.Win.Navigation
#Declaration
public T GetService<T>(
string key,
ServiceSearchMode searchMode = ServiceSearchMode.PreferLocal
)
where T : class
#Parameters
Name | Type | Description |
---|---|---|
key | String | A service identifier. |
#Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
search |
Service |
Prefer |
A Service |
#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