Oakrey.Applications.Abstractions
6.0.0
dotnet add package Oakrey.Applications.Abstractions --version 6.0.0
NuGet\Install-Package Oakrey.Applications.Abstractions -Version 6.0.0
<PackageReference Include="Oakrey.Applications.Abstractions" Version="6.0.0" />
<PackageVersion Include="Oakrey.Applications.Abstractions" Version="6.0.0" />
<PackageReference Include="Oakrey.Applications.Abstractions" />
paket add Oakrey.Applications.Abstractions --version 6.0.0
#r "nuget: Oakrey.Applications.Abstractions, 6.0.0"
#:package Oakrey.Applications.Abstractions@6.0.0
#addin nuget:?package=Oakrey.Applications.Abstractions&version=6.0.0
#tool nuget:?package=Oakrey.Applications.Abstractions&version=6.0.0
Oakrey.Applications.Abstractions
Core abstractions and base classes for Oakrey WPF desktop applications.
This library is a lightweight contract layer. It defines the interfaces and base classes that the rest of the ApplicationServices packages depend on, keeping consumers decoupled from any specific implementation.
Main features
| Type | Purpose |
|---|---|
IApplicationInfo |
Exposes application identity: name, version, logo, help path, log paths, deployment URL, and settings paths. |
AppInfoBase |
Default implementation of IApplicationInfo. Derives paths from the entry assembly and the Windows user profile. Requires an Assets/icon.png file. |
ISettingsService / ISettingsService<TSettings> |
Generic key/value settings contract with persistent (Get/Set) and volatile (GetVolatile/SetVolatile) storage. |
SettingsBase |
Abstract ViewModelBase wrapper around ISettingsService. Provides caller-name-aware property accessors that automatically call Save and raise PropertyChanged. |
PathsAndNames |
Static helpers that resolve the entry assembly name, default settings directory, and per-user roaming settings directory (%AppData%\<AppName>). |
IPreLoadable |
Async contract for services that must complete an initialisation step before the application starts. Surfaces errors as PreLoadingException via IObservable<PreLoadingException>. |
PreLoadingException |
Structured exception for pre-load failures. Carries a Details string in addition to the standard message and inner exception. |
KeyboardExtension |
WPF utility. Detects whether the "clean config" key combination (Left Alt + Left Shift) is pressed at startup. |
Architecture
graph TD
subgraph Abstractions ["Oakrey.Applications.Abstractions"]
IApplicationInfo
AppInfoBase
ISettingsService
SettingsBase
PathsAndNames
IPreLoadable
PreLoadingException
KeyboardExtension
end
AppInfoBase -->|implements| IApplicationInfo
SettingsBase -->|uses| ISettingsService
IPreLoadable -->|surfaces| PreLoadingException
The library has no dependency on any other ApplicationServices package except Oakrey.Log and Oakrey.ViewModels (used by SettingsBase).
Requirements
- .NET 10 (
net10.0-windows) - Windows OS (WPF dependency)
Assets/icon.pngpresent in the application output directory when usingAppInfoBase.Logo
Build
dotnet build Abstractions/Abstractions.csproj
Pack as a NuGet package:
dotnet pack Abstractions/Abstractions.csproj -c Release
The package ID is Oakrey.Applications.Abstractions.
Usage
Application info
public class MyAppInfo : AppInfoBase
{
public override string DeploymentUrl => "https://example.com/deploy/myapp";
}
Register and consume via IApplicationInfo:
services.AddSingleton<IApplicationInfo, MyAppInfo>();
Settings
public class AppSettings : SettingsBase
{
public AppSettings(ISettingsService settingsService)
: base(settingsService) { }
public string Theme
{
get => Get<string>() ?? "Dark";
set => Set(value);
}
}
CallerMemberName is used automatically, so the property name becomes the storage key.
Pre-loading
public class DatabasePreLoader : IPreLoadable
{
public IDisposable Subscribe(IObserver<PreLoadingException> observer) { ... }
public async Task Preload(CancellationToken cancellationToken)
{
// perform async initialisation
}
}
Clean-config detection
if (KeyboardExtension.IsCleanConfigCombinationPressed())
{
// delete or reset stored settings before the main window opens
}
Development notes
SettingsBaseautomatically callsISettingsService.Saveon every persistentSetcall. Volatile values are not saved to disk.- Log files are written to
%LocalAppData%\<AppName>\Logs\with a timestamp-based file name. - Default settings are read from the application base directory (
DefaultSettings.json). User settings are stored in%AppData%\<AppName>\Settings.json. PathsAndNamesreads fromAssembly.GetEntryAssembly(). In unit test hosts this may differ from the assembly under test � account for this in test setup.
License
MIT -- Copyright Oakrey 2016-present
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Oakrey.Log (>= 2.0.1)
- Oakrey.ViewModels (>= 2.1.0)
- System.Reactive (>= 6.1.0)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on Oakrey.Applications.Abstractions:
| Package | Downloads |
|---|---|
|
Oakrey.Applications.Settings
WPF-only (.NET 10 Windows) library providing ISettingsService with persistent and volatile typed key-value settings, SettingsBase for bindable ViewModelBase-derived settings classes, CallerMemberName key inference, built-in window bounds restore via RestoreBounds, and a one-call ConfigureSettingService DI extension. |
|
|
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. |
|
|
Oakrey.Applications.SplashScreen
Windows (.NET 10, WPF) library for async splash screens with parallel preload tasks and MSI update flow. Generic SplashScreenService<T> integrates IApplicationInfo metadata, Oakrey.Log, and Oakrey.Telemetry; registers via a single IServiceCollection extension. |
|
|
Oakrey.Applications.Log
Integrates Oakrey logging into .NET WPF apps via IServiceCollection extensions: registers a WpfQueueLogger for real-time UI log visualization, a settings-persisted LogViewModel with log-level filtering, and a preloadable log file cleanup service with a 7-day retention policy. |
|
|
Oakrey.Applications.ControlObjects
A .NET WPF library for building interactive, validated control objects. Provides a base class hierarchy for reactive sending objects, enable/disable and timer-driven variants, cancelable async operations, device abstraction, multi-key gesture support, and observable collections with automatic JSON persistence. |
GitHub repositories
This package is not used by any popular GitHub repositories.