# JsonFileApplicationSettingsService class

The default IApplicationSettingsService: keeps the values in a JSON file in the per-user application data folder, so they survive a restart of the application.

**Namespace:** [`Eremex.AvaloniaUI.Controls.ApplicationServices`](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/index.md)  
**Assembly:** `Eremex.Avalonia.Controls.ApplicationServices.dll`  
**NuGet Package:** [Eremex.Avalonia.Controls.ApplicationServices](https://www.nuget.org/packages/Eremex.Avalonia.Controls.ApplicationServices)

## Declaration

```csharp
public class JsonFileApplicationSettingsService : IApplicationSettingsService
```

## Constructors

| name | description |
| --- | --- |
| [JsonFileApplicationSettingsService](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/JsonFileApplicationSettingsService/JsonFileApplicationSettingsService/index.md)() | Initializes a new instance that stores the values in the default per-user location. |
| [JsonFileApplicationSettingsService](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/JsonFileApplicationSettingsService/JsonFileApplicationSettingsService/index.md)(…) | Initializes a new instance that stores the values in the given file. |

## Properties

| name | description |
| --- | --- |
| [FilePath](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/JsonFileApplicationSettingsService/FilePath/index.md) { get; } | The path of the file the values are stored in. |

## Methods

| name | description |
| --- | --- |
| [Remove](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/JsonFileApplicationSettingsService/Remove/index.md)(…) |  |
| [SetValue&lt;T&gt;](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/JsonFileApplicationSettingsService/SetValue/index.md)(…) |  |
| [TryGetValue&lt;T&gt;](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/JsonFileApplicationSettingsService/TryGetValue/index.md)(…) |  |

## Remarks

The file is `settings.json` in a folder named after the entry assembly, inside `%AppData%` on Windows, `~/Library/Application Support` on macOS and `$XDG_CONFIG_HOME` (`~/.config` by default) on Linux. The file is read on first use and rewritten after every change. A missing, unreadable or corrupt file is treated as empty, and a failure to write never throws: the values stay available in memory for the rest of the session.

## See Also

* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](https://eremexcontrols.net/API/Eremex.AvaloniaUI.Controls.ApplicationServices/index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Avalonia.Controls.ApplicationServices.dll -->
