![]() |
VOOZH | about |
dotnet add package Oakrey.Applications.Settings --version 6.0.1
NuGet\Install-Package Oakrey.Applications.Settings -Version 6.0.1
<PackageReference Include="Oakrey.Applications.Settings" Version="6.0.1" />
<PackageVersion Include="Oakrey.Applications.Settings" Version="6.0.1" />Directory.Packages.props
<PackageReference Include="Oakrey.Applications.Settings" />Project file
paket add Oakrey.Applications.Settings --version 6.0.1
#r "nuget: Oakrey.Applications.Settings, 6.0.1"
#:package Oakrey.Applications.Settings@6.0.1
#addin nuget:?package=Oakrey.Applications.Settings&version=6.0.1Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.Settings&version=6.0.1Install as a Cake Tool
WPF-only (.NET 10, Windows) library providing persistent and volatile typed key-value settings backed by JSON, bindable SettingsBase view-model integration, automatic CallerMemberName key inference, built-in window-bounds restore, and a one-call DI registration extension.
ISettingsService / ISettingsService<T> - typed, generic service for loading, saving and querying settings per settings class.SettingsBase - abstract base class deriving from ViewModelBase; combines ISettingsService with INotifyPropertyChanged so settings properties bind directly in WPF.CallerMemberName key inference - Get<T>() and Set<T>() use the calling property name as the storage key automatically; no magic strings required.RestoreBounds - ready-made settings class that stores and restores Top, Left, Width, Height for a Window, with sensible minimum-value guards.RestoreBoundExtension - ApplyRestoreBounds and SaveRestoreBounds extension methods on System.Windows.Window.IJsonSettingService; each settings class occupies its own section keyed by its full type name.ConfigureSettingService(IServiceCollection) call registers all required services.Oakrey.Log and Oakrey.Telemetry.Tracing.classDiagram
class ISettingsService {
+Get~TValue~(key) TValue
+GetVolatile~TValue~(key) TValue
+Set~TValue~(value, key)
+SetVolatile~TValue~(value, key)
+Load()
+Save()
+AppSettingPath string
}
class SettingsService~TSetting~ {
-settingsStorage Dictionary
-volatileSettingsStorage Dictionary
-jsonService IJsonSettingService
}
class SettingsBase {
#Get~TValue~(key) TValue
#Set~TValue~(value, key)
#GetVolatile~TValue~(key) TValue
#SetVolatile~TValue~(value, key)
}
class RestoreBounds {
+Top int
+Left int
+Width int
+Height int
}
ISettingsService <|.. SettingsService~TSetting~
SettingsBase --> ISettingsService
RestoreBounds --|> SettingsBase
Oakrey.Log, Oakrey.ViewModelsJson, Application, ViewModelsNuGet Package Manager
Oakrey.Applications.Settings and install..NET CLI
dotnet add package Oakrey.Applications.Settings
Package Manager Console
Install-Package Oakrey.Applications.Settings
Register all required services with a single call in your DI setup:
services.ConfigureSettingService();
This registers IFileService, IJsonSettingService, and the open-generic ISettingsService<>.
public sealed class AppSettings(ISettingsService<AppSettings> settingsService)
: SettingsBase(settingsService)
{
public string Theme
{
get => Get<string>() ?? "Dark";
set => Set(value);
}
public bool ShowToolbar
{
get => Get<bool>();
set => Set(value);
}
}
Register with DI:
services.ConfigureSettingService();
services.AddTransient<AppSettings>();
// In Window.Loaded
window.ApplyRestoreBounds(restoreBounds);
// In Window.Closing
window.SaveRestoreBounds(restoreBounds);
Register RestoreBounds in DI (it is resolved via ISettingsService<RestoreBounds>):
services.ConfigureSettingService();
services.AddTransient<RestoreBounds>();
TSetting is used as the JSON section key.SettingsService<T> implements IDisposable; Dispose() triggers a final Save().RestoreBounds enforces a minimum of 100 px for position and 768 px for dimensions.| Field | Value |
|---|---|
| Author | Oakrey |
| License | MIT |
| Target framework | net10.0-windows |
| NuGet package | Oakrey.Applications.Settings |
| Repository | https://dev.azure.com/oakrey/OpenPackages/_git/ApplicationServices |
This project is licensed under the MIT License. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 net10.0-windows7.0 is compatible. |
Showing the top 1 NuGet packages that depend on Oakrey.Applications.Settings:
| Package | Downloads |
|---|---|
|
Oakrey.Applications.Base
A foundational .NET library for building modular WPF applications. Provides application lifecycle management, MVVM ViewModel resolution, structured logging, telemetry, and sequential or parallel service preloading with full unhandled-exception coverage. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.1 | 87 | 6/16/2026 |
| 6.0.0 | 111 | 5/22/2026 |
| 5.1.6 | 108 | 5/22/2026 |
| 5.1.5 | 114 | 5/15/2026 |
| 5.1.4 | 135 | 3/13/2026 |
| 5.1.0 | 138 | 2/13/2026 |
| 5.0.1 | 122 | 2/11/2026 |
| 5.0.0 | 439 | 11/18/2025 |
| 4.0.1 | 201 | 10/31/2025 |
| 4.0.0 | 226 | 10/22/2025 |
| 3.3.1 | 189 | 10/10/2025 |
| 3.2.0 | 248 | 9/29/2025 |
| 3.1.0 | 230 | 9/23/2025 |
| 3.0.0 | 228 | 9/8/2025 |
| 2.0.0 | 363 | 6/9/2025 |
| 1.0.0 | 305 | 4/17/2025 |