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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Oakrey.Applications.Abstractions" Version="7.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Applications.Abstractions" Version="7.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.Applications.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Oakrey.Applications.Abstractions --version 7.0.0
                    
#r "nuget: Oakrey.Applications.Abstractions, 7.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Oakrey.Applications.Abstractions@7.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Oakrey.Applications.Abstractions&version=7.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.Abstractions&version=7.0.0
                    
Install as a Cake Tool

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

  • SettingsBase automatically calls ISettingsService.Save on every persistent Set call. Volatile values are not saved to disk.
  • Setting updates and failures are logged without including setting values, which may contain secrets.
  • KeyboardExtension returns false when no WPF application exists or its dispatcher is shutting down.

License

MIT -- Copyright Oakrey 2016-present

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
7.0.0 223 7/20/2026
6.0.2 188 7/8/2026
6.0.1 182 7/3/2026
6.0.0 221 5/22/2026
1.0.0 196 5/22/2026