# ApplicationServicesContext.GetService&lt;T&gt; method

Returns the service, or `null` if it is not registered or the context has not been initialized yet.

```csharp
public static T? GetService<T>()
    where T : class
```

| parameter | description |
| --- | --- |
| T | The service type to resolve, normally an interface. |

## Return Value

The registered service instance, or `null` when the service is not registered or [`Current`](./Current.md) has not been set.

## See Also

* class [ApplicationServicesContext](../ApplicationServicesContext.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Avalonia.Controls.ApplicationServices.dll -->
