Oakrey.Applications.Abstractions
7.0.0
dotnet add package Oakrey.Applications.Abstractions --version 7.0.0
NuGet\Install-Package Oakrey.Applications.Abstractions -Version 7.0.0
<PackageReference Include="Oakrey.Applications.Abstractions" Version="7.0.0" />
<PackageVersion Include="Oakrey.Applications.Abstractions" Version="7.0.0" />
<PackageReference Include="Oakrey.Applications.Abstractions" />
paket add Oakrey.Applications.Abstractions --version 7.0.0
#r "nuget: Oakrey.Applications.Abstractions, 7.0.0"
#:package Oakrey.Applications.Abstractions@7.0.0
#addin nuget:?package=Oakrey.Applications.Abstractions&version=7.0.0
#tool nuget:?package=Oakrey.Applications.Abstractions&version=7.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. |
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. |
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
ISettingsService
SettingsBase
IPreLoadable
PreLoadingException
KeyboardExtension
end
SettingsBase -->|uses| ISettingsService
IPreLoadable -->|surfaces| PreLoadingException
The library depends on Oakrey.Log.Abstractions and Oakrey.ViewModels, both used by SettingsBase. IObservable<T> is provided by the .NET base class library, so consumers do not need System.Reactive merely to implement IPreLoadable.
Requirements
- .NET 10 (
net10.0-windows) - Windows OS (WPF dependency)
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 sealed class MyAppInfo : IApplicationInfo
{
// Implement the metadata and path properties required by IApplicationInfo.
}
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.- Setting updates and failures are logged without including setting values, which may contain secrets.
KeyboardExtensionreturnsfalsewhen no WPF application exists or its dispatcher is shutting down.
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.Abstractions (>= 3.0.0)
- Oakrey.ViewModels (>= 3.0.0)
NuGet packages (18)
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 explicit dependency-injection integration. |
|
|
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.