Skip to content

Kinnara/ModernWpf

Repository files navigation

ModernWPF UI Library

Gitter

Modern styles and controls for your WPF applications.

Maintenance status

ModernWpf is restarting active maintenance on a new 1.x line.

Line Status Support
0.9.x Legacy Security-only fixes for existing applications.
1.x Active preview New maintenance line for current WPF applications.

The NuGet package name remains ModernWpfUI. The first 1.x maintenance release candidate is 1.0.0-preview.1. See the 1.x public API contract for the forward-compatibility boundary and the comparison with 0.9.x, current WinUI, and official WPF Fluent. Applications upgrading from 0.9.x should also read the migration guide and preview release notes.

Supported targets

Target framework Theme source Notes
net462 ModernWpf Fluent backport Compatibility target for existing .NET Framework WPF apps.
net8.0-windows7.0 ModernWpf Fluent backport Current LTS target for WPF apps.
net10.0-windows7.0 WPF platform Fluent theme plus ModernWpf controls Uses the official PresentationFramework.Fluent resources for stock WPF controls.

Features

Overview of controls (light theme)

Quick start

  1. Create a new WPF app.

  2. Install from NuGet Install-Package ModernWpfUI.

  3. Edit App.xaml to use the recommended 1.x resource entry:

<Application
    ...
    xmlns:ui="http://schemas.modernwpf.com/2019">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ui:ThemeResources />
                <ui:FluentControlsResources UseCompactResources="False" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

FluentControlsResources uses the official WPF Fluent theme on net10.0-windows7.0 and the ModernWpf Fluent backport on older supported targets. On net10.0-windows7.0, ThemeManager.ApplicationTheme and window ThemeManager.RequestedTheme are also bridged to the official WPF ThemeMode APIs. Element-level theme islands continue to use ModernWpf's WinUI-compatible resource dictionaries so existing per-control theme scopes keep working on every supported target.

For existing 0.9.x applications, the old resource entry remains supported:

<Application
    ...
    xmlns:ui="http://schemas.modernwpf.com/2019">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ui:ThemeResources />
                <ui:XamlControlsResources />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
  1. Edit MainWindow.xaml to following:
<Window
    ...
    xmlns:ui="http://schemas.modernwpf.com/2019"
    ui:WindowHelper.UseModernWindowStyle="True">
    <ui:StackPanelEx Margin="12" Spacing="24">
        <TextBlock Text="My first ModernWPF app" Style="{StaticResource HeaderTextBlockStyle}" />
        <Button Content="I am a button" />
        <Button Content="I am an accent button" Style="{StaticResource AccentButtonStyle}" />
    </ui:StackPanelEx>
</Window>
  1. See the wiki for more information.

Packages

NuGet Package Latest Versions
ModernWpfUI latest stable version
latest prerelease version

Screenshots

Overview of controls (dark theme)

Control palette

Easily customize colors

NumberBox

ContentDialog

DataGrid

ItemsRepeater

Custom title bar

Calendar

Menu

Progress controls

Color ramp

Accent color palette

High contrast mode

About

Modern styles and controls for your WPF applications

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages