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.
- ViewModelBase —
INotifyPropertyChangedbase withSetProperty, batch notification, and UI thread helpers - ToolWindowViewModel — Base for tabbed/dockable tool windows with title deduplication, visibility tracking, and close support
- RelayCommand — Simple
ICommandimplementation withCanExecutesupport
- 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
- 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
- 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
- LargeNumberConverter — IValueConverter formatting numbers as 1.5B, 2.3M, 4.7K
- NumericInputBehavior — Attached behavior restricting TextBox input to integers or decimals
dotnet add package Raisin.WPF.Base
public class MyViewModel : ViewModelBase
{
private string _title = "";
public string Title
{
get => _title;
set => SetProperty(ref _title, value, nameof(Title));
}
}protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
DarkWindowHelper.Apply(this);
}<DataGrid local:DataGridColumnBehavior.GridId="MyGrid" ... />- Raisin.Core — atomic file I/O, app paths
- Raisin.EventSystem — event bus
- Raisin.AvalonDock — docking framework
- MaterialDesignThemes — Material Design resources
MIT