# ApplicationServicesContext.SetCurrent method

Sets the current service provider. Called once at application startup. Passing `null` resets the context (used in tests).

```csharp
public static void SetCurrent(IServiceProvider? serviceProvider)
```

| parameter | description |
| --- | --- |
| serviceProvider | The provider that resolves the application services, or `null` to clear the context. |

## 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 -->
