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
                    
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="6.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="6.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 6.0.0
                    
#r "nuget: Oakrey.Applications.Abstractions, 6.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@6.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=6.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.Abstractions&version=6.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.
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.png present in the application output directory when using AppInfoBase.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

  • SettingsBase automatically calls ISettingsService.Save on every persistent Set call. 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.
  • PathsAndNames reads from Assembly.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 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 (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.

Version Downloads Last Updated
6.0.0 0 5/22/2026
1.0.0 0 5/22/2026