Oakrey.Applications.UI
3.0.5
dotnet add package Oakrey.Applications.UI --version 3.0.5
NuGet\Install-Package Oakrey.Applications.UI -Version 3.0.5
<PackageReference Include="Oakrey.Applications.UI" Version="3.0.5" />
<PackageVersion Include="Oakrey.Applications.UI" Version="3.0.5" />
<PackageReference Include="Oakrey.Applications.UI" />
paket add Oakrey.Applications.UI --version 3.0.5
#r "nuget: Oakrey.Applications.UI, 3.0.5"
#:package Oakrey.Applications.UI@3.0.5
#addin nuget:?package=Oakrey.Applications.UI&version=3.0.5
#tool nuget:?package=Oakrey.Applications.UI&version=3.0.5
Oakrey.Applications.UI
A WPF UI library for .NET 10 that provides a DarkWindow base class with native DWM Mica/Acrylic backdrops, a ready-made TabbedWindow with animated page transitions and automatic Windows light/dark theme tracking, a thread-safe notification bar service, and severity-typed message box and prompt dialogs.
- Package:
Oakrey.Applications.UI - Target framework: .NET 10 (Windows / WPF)
- License: MIT
Main features
- DarkWindow �
Windowsubclass that calls intodwmapi.dllto extend the DWM frame, enable immersive dark mode, and apply a native backdrop (Mica by default). Requires no additional configuration. - TabbedWindow � full-featured navigation shell with a side-menu tab list, animated page transitions (fade + slide), optional bottom and left widget slots, configurable menu width, app version label, and automatic Windows light/dark theme following via a registry watcher.
- BackgroundType �
Auto,None,Mica,Acrylic,Tabbed� configurable perTabbedWindowinstance via a dependency property. - WindowsTheme �
Auto,Light,Dark� trackable and overridable; theme changes raiseThemeChangedEventArgs. - NotificationService � static service with
Error,Warning,Info,Progressfactory methods and persistent/cancellable variants. Thread-safe; works before aNotificationBaris registered (null-object pattern). - NotificationBar �
UserControlthat self-registers withNotificationServiceon construction. Hosts anObservableCollection<INotification>bound to the UI. - INotification / INotificationBar � interfaces enabling custom notification rendering or testing without a real UI.
- MsgBox � static helper with
Show/ShowDialogoverloads accepting message, title,Severity, and optional details string. Marshals to the UI thread automatically. - Prompt � static helper for typed input dialogs:
String,Int,Double,ComboBox, dynamic enum buttons, and the standardYesNo,OkCancel,YesNoCancel,SaveCloseCancelbutton sets. - LoggerMessageBoxExtensions �
ILoggerextension methods that log and immediately show a matchingMsgBox:ShowError,ShowWarning,ShowInfo,ShowSuccess,ShowDialogError, etc.
Project structure
UI/
DarkWindow.cs # DWM dark window base class
Notifications/
INotification.cs # Notification handle interface
INotificationBar.cs # Bar registration interface
Icon.cs # Notification icon enum
IconConverter.cs # Icon-to-resource converter
Notification.cs # Default INotification implementation
NotificationBar.xaml/.cs # UserControl - rendered notification list
NotificationService.cs # Static notification factory
CloseNotification.cs # Close-button notification subtype
Prompts/
Severity.cs (in Prompt.cs) # ERROR / WARNING / EXCEPTION / SUCCESS / INFO
Prompt.cs # Static typed input dialog helpers
MsgBox.cs # Static message box helpers
LoggerMessageBoxExtensions.cs # ILogger + MsgBox bridge extensions
DynamicButtonsWindow.xaml/.cs # Enum-driven button dialog
DynamicButtonsCreator.cs
PromptBoxString/Int/Double.xaml/.cs
ComboBoxWindow.xaml/.cs
MessageBoxGeneral.xaml/.cs
TabbedWindow/
TabbedWindow.cs # Main navigation shell Window
TabWindowItem.cs # Tab descriptor (label, glyph, page Uri)
BackgroundType.cs # DWM backdrop enum
WindowsTheme.cs # Theme enum
ThemeWatcher.cs # Registry-based theme change watcher
ThemeChangedEventArgs.cs
DwmNative.cs # P/Invoke wrappers for dwmapi.dll
Glyph.cs / GlyphConverter.cs # Icon glyph support
Architecture
graph TD
App["Your App.xaml.cs"] --> TabbedWindow
App --> DarkWindow
TabbedWindow --> ThemeWatcher["ThemeWatcher<br>(registry watcher)"]
TabbedWindow --> DwmNative["DwmNative<br>(dwmapi P/Invoke)"]
TabbedWindow --> TabWindowItem["TabWindowItem list<br>(label, glyph, page Uri)"]
DarkWindow --> dwmapi["dwmapi.dll<br>(DwmExtendFrameIntoClientArea<br>DwmSetWindowAttribute)"]
NotificationBar["NotificationBar (UserControl)"] --> NotificationService["NotificationService (static)"]
NotificationService --> INotificationBar
NotificationService --> INotification
MsgBox["MsgBox (static)"] --> Invoker["Oakrey.Async.Windows.Invoker<br>(UI thread marshal)"]
Prompt["Prompt (static)"] --> Invoker
LoggerExt["LoggerMessageBoxExtensions"] --> MsgBox
LoggerExt --> ILogger["Oakrey.Log.ILogger"]
Requirements
- .NET 10 or higher
- Windows (WPF)
- Windows 11 or Windows 10 build 22000+ recommended for Mica/Acrylic backdrops
Installation
.NET CLI
dotnet add package Oakrey.Applications.UI
Package Manager Console
Install-Package Oakrey.Applications.UI
NuGet Package Manager
- Open Visual Studio.
- Navigate to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
- Search for
Oakrey.Applications.UIand click Install.
Example usage
DarkWindow
Inherit from DarkWindow instead of Window. No additional code is required; the Mica backdrop and dark title bar are applied automatically.
<ui:DarkWindow x:Class="MyApp.MainWindow"
xmlns:ui="clr-namespace:Oakrey.Applications.UI;assembly=Oakrey.Applications.UI"
Title="My App" Width="1000" Height="700">
</ui:DarkWindow>
TabbedWindow
<ui:TabbedWindow x:Class="MyApp.MainWindow"
xmlns:ui="clr-namespace:Oakrey.Applications.UI.TabbedWindow;assembly=Oakrey.Applications.UI"
Theme="Auto"
BackgroundType="Mica"
AppVersion="1.0.0"
MenuWidth="220">
<ui:TabbedWindow.Tabs>
<ui:TabWindowItem Label="Dashboard" Page="/Pages/DashboardPage.xaml"/>
<ui:TabWindowItem Label="Settings" Page="/Pages/SettingsPage.xaml"/>
</ui:TabbedWindow.Tabs>
</ui:TabbedWindow>
NotificationBar
Place the control once in your shell window XAML. It self-registers with NotificationService on construction.
<notifications:NotificationBar
xmlns:notifications="clr-namespace:Oakrey.Applications.UI.Notifications;assembly=Oakrey.Applications.UI"
VerticalAlignment="Bottom"/>
Trigger notifications from anywhere in the application:
NotificationService.Info("File loaded successfully.");
NotificationService.ErrorPersistent("Connection lost.");
INotification progress = NotificationService.ProgressCancellable("Uploading...");
// later:
progress.Close();
MsgBox
MsgBox.Show("Operation failed.", Severity.ERROR, exception.Message);
MsgBox.ShowDialog("Confirm deletion?", "Delete record", Severity.WARNING);
Prompt
if (Prompt.String(out string? name, "Enter your name", "Name"))
{
// name is set
}
if (Prompt.Int(out int count, "Enter count", "Count"))
{
// count is set
}
if (Prompt.YesNo(out YesNo result, "Save changes?", "Confirm"))
{
// result == YesNo.Yes or YesNo.No
}
ILogger extensions
// Logs via Oakrey.Log and shows a MsgBox in one call
logger.ShowError("Export failed", exception);
logger.ShowWarning("Low disk space", "Only {0} MB remaining", freeMb);
Development notes
NotificationServiceuses a null-objectNullNotificationBarbefore anyNotificationBaris registered, so notification calls are always safe and do not throw.- All
MsgBoxandPromptmethods marshal to the UI thread internally viaOakrey.Async.Windows.Invoker, making them safe to call from background threads. ThemeWatchermonitorsHKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalizevia WMI event subscription and raisesThemeChangedon change.DwmNativeandDarkWindowboth calldwmapi.dlldirectly via P/Invoke.AllowUnsafeBlocksis required and is already set in the project file.- To create a custom notification renderer, implement
INotificationBarand register it withNotificationService.RegisterNotificationBar(bar).
Project information
- Author: Oakrey
- Company: Oakrey
- License: MIT
- NuGet: Oakrey.Applications.UI
- Repository: Azure DevOps
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Oakrey.Applications.Resources.Modern (>= 2.1.2)
- Oakrey.Async.Windows (>= 2.2.0)
- Oakrey.Log (>= 2.0.0)
- Oakrey.Wpf.Converters (>= 2.1.0)
- System.Management (>= 10.0.8)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Oakrey.Applications.UI:
| Package | Downloads |
|---|---|
|
Oakrey.Applications.License
Provides application license management for .NET WPF apps: signature and threshold-based validation, trial and expiration support, reactive license status via IObservable<bool>, custom exception types, and a ready-made LicenseWindow WPF dialog. |
|
|
Oakrey.Applications.About
A WPF/.NET library providing an About dialog with application name and version display, loaded assembly/module version listing, RTF EULA rendering, and a Report Issue form with log folder access. |
|
|
Oakrey.Applications.UserPrompts.Custom
Custom WPF implementation of UserPrompts.Abstractions with enhanced styled dialogs. Features custom-designed prompts with severity-based styling, integrated logging, and modern UI. Includes support for information messages, questions, user input, and selections with professional Oakrey design language. |
GitHub repositories
This package is not used by any popular GitHub repositories.