Raisin.WPF.Base 2.0.0

dotnet add package Raisin.WPF.Base --version 2.0.0
                    
NuGet\Install-Package Raisin.WPF.Base -Version 2.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="Raisin.WPF.Base" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Raisin.WPF.Base" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Raisin.WPF.Base" />
                    
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 Raisin.WPF.Base --version 2.0.0
                    
#r "nuget: Raisin.WPF.Base, 2.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 Raisin.WPF.Base@2.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=Raisin.WPF.Base&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Raisin.WPF.Base&version=2.0.0
                    
Install as a Cake Tool

Raisin.WPF.Base

Shared WPF base library for .NET 8 desktop applications — MVVM foundation, window management, docking layout persistence, data grid behaviors, settings infrastructure, and dark theme support.

Features

MVVM

  • ViewModelBaseINotifyPropertyChanged base with SetProperty, batch notification, and UI thread helpers
  • ToolWindowViewModel — Base for tabbed/dockable tool windows with title deduplication, visibility tracking, and close support
  • RelayCommand — Simple ICommand implementation with CanExecute support

Window management

  • WindowPlacementHelper — Capture, restore, and validate window position across monitor configurations
  • DarkWindowHelper — Apply Windows 11 dark mode to window chrome (title bar, background) with WM_ERASEBKGND interception to prevent white flash
  • DockLayoutHelper — Save and restore AvalonDock layouts to XML with atomic file writes

Data grid

  • DataGridColumnBehavior — Attached behavior for auto-fit and persistent column widths with right-click context menu
  • AdaptiveHeader — Column headers that switch between full and abbreviated text based on available width
  • GridSettingsService — Persists column widths to JSON with in-memory cache

Settings infrastructure

  • SettingDefinition — Declarative metadata for settings (category, editor type, bounds, choices)
  • SettingItemViewModel hierarchy — Concrete view models for Bool, Int, Double, String, TimeOnly, Choice, IntList, and compound types (Offset, TimePair, IntPair, DoublePair)
  • SettingItemFactory — Creates the right view model from a definition
  • SettingItemTemplateSelector — WPF DataTemplateSelector for rendering each setting type

Other utilities

  • LargeNumberConverter — IValueConverter formatting numbers as 1.5B, 2.3M, 4.7K
  • NumericInputBehavior — Attached behavior restricting TextBox input to integers or decimals

Installation

dotnet add package Raisin.WPF.Base

Quick start

View model

public class MyViewModel : ViewModelBase
{
    private string _title = "";
    public string Title
    {
        get => _title;
        set => SetProperty(ref _title, value, nameof(Title));
    }
}

Dark window

protected override void OnSourceInitialized(EventArgs e)
{
    base.OnSourceInitialized(e);
    DarkWindowHelper.Apply(this);
}

Persistent column widths

<DataGrid local:DataGridColumnBehavior.GridId="MyGrid" ... />

Dependencies

License

MIT

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

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 65 6/8/2026
1.0.1 112 3/25/2026
1.0.0 101 3/22/2026