Open-Source WPF Control Library: ModernWpf

Open-Source WPF Control Library: ModernWpf

It has a very beautiful interface, entirely in Win10 style. The interface portion is similar to the default UWP. This library supports .NET Framework 4.5 and above, as well as .NET Core 3.0 and above, and can run on Windows Vista SP2 and above.

Last updated 9/16/2020 1:45 PM
沙漠尽头的狼
2 min read
Category
.NET
Topic
WPF Control Library WPF Open Source Project
Tags
.NET C# WPF Control Library WPF Open Source Project

ModernWpf repository info

The site admin learned about this UI library from Lin Dexi on the CNBlogs. After cloning, compiling, and running it, I found it to be quite good. As Lin Dexi said: "It has a very beautiful interface, all in Windows 10 style, and the UI part is similar to the default UWP. This library supports .NET Framework 4.5 and above, as well as .NET Core 3.0 and above, and can run on Windows Vista SP2 and above." So I copied the readme from that repository, hoping to let more people know about the existence of this library and give WPF developers one more UI library choice.

White theme

Quick start

  1. Create a WPF application
  2. Install the ModernWpfUI package from NuGet.
  3. Edit App.xaml:
<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:
<Window
    ...
    xmlns:ui="http://schemas.modernwpf.com/2019"
    ui:WindowHelper.UseModernWindowStyle="True">
    <ui:SimpleStackPanel 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:SimpleStackPanel>
</Window>

Screenshots

Keep Exploring

Related Reading

More Articles
Same category / Same tag 5/27/2025

WPF Achieve a Danger Reminder Effect

When our program is released and users are performing dangerous operations, our software should provide some reminder effects, such as a red border edge, similar to the warning effect in Amap.

Continue Reading
Same category / Same tag 6/20/2024

CodeWF.EventBus: Lightweight Event Bus for Smoother Communication

CodeWF.EventBus is a flexible event bus library that enables decoupled communication between modules. It supports various .NET project types such as WPF, WinForms, ASP.NET Core, etc. With a clean design, it easily implements command publishing and subscribing, as well as requests and responses. Through orderly event handling, it ensures events are properly processed. Simplify your code and improve system maintainability.

Continue Reading