Skip to content

USACE-RMC/WPF-Framework

Repository files navigation

WPF Framework

CI DOI NuGet License: 0BSD

WPF Framework is a free and open-source .NET 10.0 application framework for building desktop project management applications, developed by the U.S. Army Corps of Engineers Risk Management Center (USACE-RMC). It provides a complete application shell with docking layout, project explorer, theme switching, undo/redo, and specialized controls for charting, databases, expression parsing, and directed acyclic graphs.

Note

This repository is under active development. Expect ongoing bug fixes and minor enhancements as the framework is prepared for broader public use.

Supported Frameworks

Platform Version
.NET 10.0
OS Windows 10+

WPF Framework can be consumed from source project references or packaged into NuGet bundles with scripts/pack-wpf-framework.ps1. The package layout follows the internal dependency map: Core, Models, Support, then Controls.

The framework depends on RMC.Numerics through central NuGet package management in Directory.Packages.props. Source builds restore the latest compatible 2.x package; NuGet bundles declare compatibility with RMC.Numerics 2.1.1 or later, below 3.0.0.

Solution Structure

Folder Projects Description
Core FrameworkInterfaces, Themes Core contracts and theming engine
Controls FrameworkUI, GenericControls, NumericControls, OxyPlotControls, DatabaseControls, ExpressionParserControls, DAGControls, Xceed.Wpf.AvalonDock, Xceed.Wpf.AvalonDock.Themes.VS2013 Application shell, reusable WPF controls, and docking UI
Models DatabaseManager, ExpressionParser, OxyPlot, OxyPlot.Wpf, OxyPlot.Wpf.Shared, DAG Platform-agnostic model and engine libraries
Support SoftwareUpdate, SoftwareUpdate.Updater GitHub Releases-based auto-update system
Demos FrameworkUI.Demo, GenericControls.Demo, NumericControls.Demo, OxyPlotControls.Demo, DatabaseControls.Demo, ExpressionParserControls.Demo, DAG.Demo Interactive demo applications
Tests OxyPlot.ExampleLibrary + 13 test projects Example chart models and xunit, MSTest, and NUnit test suites
Packaging RMC.Wpf.Framework.Core, RMC.Wpf.Framework.Models, RMC.Wpf.Framework.Support, RMC.Wpf.Framework.Controls NuGet bundle projects

Quick Start

Prerequisites

  • .NET 10.0 SDK
  • Visual Studio 2022 (17.12 or later)
  • Windows 10 or later

Build and Test

dotnet build WPF-Framework.sln
dotnet test WPF-Framework.sln

Build Packages

.\scripts\pack-wpf-framework.ps1 -Configuration Release -Version 1.0.0

This creates and validates the following NuGet packages in artifacts/packages/:

Package Includes Depends on
RMC.Wpf.Framework.Core FrameworkInterfaces, Themes None
RMC.Wpf.Framework.Models DAG, DatabaseManager, ExpressionParser, OxyPlot libraries ClosedXML, DocumentFormat.OpenXml, ExcelNumberFormat, FastMember, SourceGear.sqlite3, System.Data.SQLite
RMC.Wpf.Framework.Support SoftwareUpdate and updater content files None
RMC.Wpf.Framework.Controls FrameworkUI, control libraries, AvalonDock fork Core, Models, Support, RMC.Numerics 2.x

Minimal Application

// In App.xaml.cs — initialize theme before creating any UI
FrameworkUI.ThemeManager.SetTheme(FrameworkUI.ThemeColor.Light);

// Create project and controller
var project = new MyProject();
var controller = new MyProjectController(project);

// Show the main window
var mainWindow = new FrameworkUI.MainWindow();
mainWindow.ProjectNode = controller;
mainWindow.Show();

Run FrameworkUI.Demo for a complete working example.

Documentation

Comprehensive documentation is available in the docs/ folder:

Document Description
Gallery Screenshot guide to the framework control libraries
Getting Started Step-by-step guide to building your first application
Architecture Solution structure, dependencies, and design patterns
Themes Runtime theme switching with Light, Dark, and Blue themes
Undo/Redo Property and collection change tracking with undo support
Generic Controls NumericTextBox, ColorPicker, CopyPasteDataGrid, and more
Numeric Controls Distribution selectors, curve editors, and time series tables
OxyPlot Controls Interactive charting with toolbar, property editors, and serialization
Database Controls Table viewing, field calculation, and expression parsing
DAG Controls Directed acyclic graph editing with visual flow canvas
Software Update Automatic updates from GitHub Releases
Migration Guide Upgrading from previous versions

Key Features

Theme Switching

Three built-in themes with runtime switching — all controls update automatically via DynamicResource bindings:

FrameworkUI.ThemeManager.SetTheme(FrameworkUI.ThemeColor.Dark);

Undo/Redo

Built-in undo/redo for element properties with automatic change tracking:

public string CustomValue
{
    get => _customValue;
    set
    {
        if (_customValue != value)
        {
            var oldValue = _customValue;
            _customValue = value;
            RecordPropertyChange(nameof(CustomValue), oldValue, value);
        }
    }
}

Docking Layout

VS2013-style docking with tabbed documents, auto-hide panels, and floating windows powered by a vendored AvalonDock fork.

Charting

Vendored OxyPlot fork with a full toolbar (pan, zoom, annotation, export), property editors, theme integration, and XML serialization.

Database Management

Multi-format database abstraction supporting SQLite, CSV, DBF, and in-memory tables with undo/redo edit tracking and Excel/CSV export.

Software Updates

Automatic update checking and installation from GitHub Releases with SemVer 2.0, SHA256 checksum validation, and backup/recovery.

Support

USACE-RMC is committed to maintaining and supporting WPF Framework with regular updates, bug fixes, and enhancements. The framework is under active development and serves as the shared foundation for our suite of desktop engineering applications.

The repository includes extensive unit tests across 13 test projects that also serve as usage examples for the classes and methods in the libraries.

Applications

WPF Framework powers the following USACE-RMC desktop applications:

  • RMC-BestFit — Bayesian estimation and fitting for flood frequency analysis
  • RMC-RFA — Reservoir frequency analysis for flood hazard assessments
  • RMC-TotalRisk — Quantitative risk analysis for dam and levee safety
  • LifeSim — Life loss consequence estimation and evacuation simulation

Related Libraries

  • RMC.Numerics - NuGet package for numerical computing, statistical analysis, and Bayesian inference (required dependency for NumericControls and DatabaseControls)

Contributing

Contributions are welcome. See CONTRIBUTING.md for guidelines.

License

This project is licensed under the Zero-Clause BSD (0BSD) license — a permissive license with no attribution or notice requirements. See LICENSE for details.

Authors

  • Haden Smith — USACE Risk Management Center
  • Woodrow Fields — USACE Risk Management Center
  • Julian Gonzalez — USACE Risk Management Center

Acknowledgments

  • Xceed for the AvalonDock docking library (vendored and modified)
  • OxyPlot contributors for the charting library (vendored fork with custom serialization)

About

WPF Framework is a free and open-source .NET application framework for building desktop project management applications with docking layout, theming, undo/redo, charting, database management, and specialized controls for water resources engineering software.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages