wpfui
WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
Top Related Projects
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
Google's Material Design in XAML & WPF, for C# & VB.Net.
Shared Controlz for WPF and ... more
All the controls missing in WPF. Over 1 million downloads.
Modern UI for WPF
Quick Overview
WPFUI is a modern UI library for WPF (Windows Presentation Foundation) applications. It provides a set of controls and styles that mimic the look and feel of Windows 11, allowing developers to create modern and visually appealing desktop applications for Windows.
Pros
- Offers a comprehensive set of controls and styles that closely resemble Windows 11 UI
- Provides easy-to-use themes and color systems for customization
- Includes support for Fluent Design System elements like Acrylic and Mica effects
- Actively maintained with regular updates and improvements
Cons
- Limited to WPF applications, not compatible with other frameworks like UWP or WinUI
- May require additional effort to maintain backward compatibility with older Windows versions
- Learning curve for developers not familiar with WPF or XAML
- Some advanced customizations might require in-depth knowledge of the library
Code Examples
- Creating a basic window with WPFUI:
<ui:UiWindow
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="MainWindow"
Height="450"
Width="800">
<Grid>
<ui:Button Content="Click me!" />
</Grid>
</ui:UiWindow>
- Applying a theme to the application:
public partial class App : Application
{
public App()
{
WPFUI.Theme.Manager.SetTheme(WPFUI.Theme.Style.Dark);
}
}
- Using the NavigationStore for navigation:
public partial class MainWindow : UiWindow
{
public MainWindow()
{
InitializeComponent();
var navigationStore = new NavigationStore();
navigationStore.NavigateTo<HomeViewModel>();
RootNavigation.NavigationStore = navigationStore;
}
}
Getting Started
-
Install the WPFUI NuGet package:
Install-Package WPFUI
-
Add the WPFUI namespace to your XAML:
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
-
Replace standard WPF controls with WPFUI controls in your XAML:
<ui:UiWindow> <ui:Button Content="Hello, WPFUI!" /> </ui:UiWindow>
-
Initialize the theme in your App.xaml.cs:
public partial class App : Application { public App() { WPFUI.Theme.Manager.SetTheme(WPFUI.Theme.Style.Dark); } }
Competitor Comparisons
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
Pros of MahApps.Metro
- More mature and established project with a larger community and extensive documentation
- Offers a wider range of controls and features, including flyouts, dialogs, and custom window styles
- Provides better support for older versions of .NET Framework
Cons of MahApps.Metro
- Heavier and more complex, which may lead to longer load times and increased memory usage
- Less focused on modern Windows UI design principles, potentially resulting in a less native look and feel
Code Comparison
MahApps.Metro:
<Controls:MetroWindow x:Class="MainWindow"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="MahApps.Metro Example">
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Button Content="Settings" />
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
</Controls:MetroWindow>
WPFUI:
<ui:UiWindow x:Class="MainWindow"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="WPFUI Example">
<ui:TitleBar>
<ui:Button Icon="Settings24" Content="Settings" />
</ui:TitleBar>
</ui:UiWindow>
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
Pros of Avalonia
- Cross-platform support (Windows, macOS, Linux, iOS, Android, WebAssembly)
- More mature and established project with a larger community
- Extensive documentation and learning resources
Cons of Avalonia
- Steeper learning curve for developers new to XAML-based frameworks
- Potentially slower performance compared to native WPF applications
Code Comparison
Avalonia:
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Avalonia Example">
<Button Content="Click me!" />
</Window>
WPFUI:
<ui:UiWindow
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="WPFUI Example">
<ui:Button Content="Click me!" />
</ui:UiWindow>
Both frameworks use XAML for UI design, but Avalonia's syntax is more similar to traditional WPF, while WPFUI introduces custom controls and namespaces for a modern Windows 11-style UI.
Avalonia offers cross-platform development capabilities, making it suitable for projects targeting multiple operating systems. WPFUI, on the other hand, focuses on providing a native Windows 11 look and feel for WPF applications, making it ideal for Windows-specific projects that require a modern UI.
Google's Material Design in XAML & WPF, for C# & VB.Net.
Pros of MaterialDesignInXamlToolkit
- More comprehensive set of UI controls and components
- Longer development history and larger community support
- Extensive documentation and examples available
Cons of MaterialDesignInXamlToolkit
- Steeper learning curve due to its extensive feature set
- May require more setup and configuration for basic projects
- Potentially heavier resource usage in some scenarios
Code Comparison
MaterialDesignInXamlToolkit:
<materialDesign:Card Padding="32" Margin="16">
<TextBlock Style="{DynamicResource MaterialDesignHeadline6TextBlock}">
Hello World
</TextBlock>
</materialDesign:Card>
wpfui:
<ui:Card Margin="12">
<TextBlock FontSize="24" FontWeight="Medium">
Hello World
</TextBlock>
</ui:Card>
Both libraries offer modern UI components, but MaterialDesignInXamlToolkit provides more specialized styles and controls out of the box. wpfui focuses on a clean, Windows 11-inspired design with simpler implementation. The code comparison shows that while both achieve similar results, MaterialDesignInXamlToolkit uses more specific styling attributes, potentially offering greater customization at the cost of added complexity.
Shared Controlz for WPF and ... more
Pros of ControlzEx
- More mature and established project with a longer history
- Broader focus on WPF controls and behaviors, not limited to UI styling
- Extensive documentation and examples available
Cons of ControlzEx
- Less modern and fluent design-oriented compared to WPFUI
- May require more manual styling and customization for a cohesive look
- Smaller community and fewer recent updates
Code Comparison
ControlzEx:
<controls:WindowChrome.WindowChrome>
<controls:WindowChrome ResizeBorderThickness="6"
CaptionHeight="32"
CornerRadius="0"
GlassFrameThickness="0" />
</controls:WindowChrome.WindowChrome>
WPFUI:
<ui:Window
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
WindowCornerPreference="Round">
<!-- Window content -->
</ui:Window>
The code snippets demonstrate the difference in approach between the two libraries. ControlzEx provides more granular control over window chrome properties, while WPFUI offers a more streamlined, modern Windows 11-style appearance with fewer configuration options.
WPFUI is better suited for developers looking to quickly implement a modern, Fluent Design-inspired interface, while ControlzEx may be preferred for those requiring more fine-grained control over WPF behaviors and custom styling.
All the controls missing in WPF. Over 1 million downloads.
Pros of WPF Toolkit
- More comprehensive set of controls and features
- Longer history and established reputation in the WPF community
- Extensive documentation and support resources
Cons of WPF Toolkit
- Larger footprint and potential performance overhead
- Some components require a commercial license
- Less focus on modern UI design principles
Code Comparison
WPF Toolkit:
<xctk:ColorPicker Name="MyColorPicker"
SelectedColor="Red"
DisplayColorAndName="True"
AvailableColorsSortingMode="HueSaturationBrightness" />
WPFUI:
<ui:ColorPicker Name="MyColorPicker"
SelectedColor="Red"
ShowAccent="True"
IsAlphaEnabled="True" />
Summary
WPF Toolkit offers a more extensive set of controls and features, backed by a longer history in the WPF ecosystem. It provides comprehensive documentation and support but comes with a larger footprint and potential licensing costs for some components. WPFUI, on the other hand, focuses on modern UI design principles and offers a more lightweight solution, albeit with a smaller set of controls. The choice between the two depends on project requirements, desired UI aesthetics, and licensing considerations.
Modern UI for WPF
Pros of MUI
- More mature and established project with a longer history
- Larger community and more extensive documentation
- Broader range of UI components and controls
Cons of MUI
- Less focused on modern Windows UI design principles
- May require more customization to achieve a native Windows look and feel
- Potentially steeper learning curve for developers new to XAML-based frameworks
Code Comparison
WPFUI:
<ui:Window
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<ui:Button
Content="Click me!"
Appearance="Primary" />
</ui:Window>
MUI:
<mui:ModernWindow
xmlns:mui="http://firstfloorsoftware.com/ModernUI">
<mui:ModernButton
Content="Click me!"
Style="{StaticResource AccentedSquareButtonStyle}" />
</mui:ModernWindow>
Both libraries offer custom controls and styles to enhance the UI experience in WPF applications. WPFUI focuses on providing a more Windows 11-like appearance, while MUI offers a broader set of customizable UI elements. The choice between the two depends on the specific project requirements, desired aesthetics, and developer preferences.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
WPF UI
Created with ⤠in Poland by lepo.co and wonderful open-source community
WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly. Library changes the base elements like Page
, ToggleButton
or List
, and also includes additional controls like Navigation
, NumberBox
, Dialog
or Snackbar
.
Deliver humanitarian aid directly to Ukraine.
https://bank.gov.ua/en/about/humanitarian-aid-to-ukraine
ð Support plans
To ensure you receive the expert guidance you need, we offer a variety of support plans designed to meet the diverse needs of our community. Whether you are looking to modernize your WPF applications or need assistance with our other libraries, our tailored support solutions are here to help. From priority email support to 24/7 dedicated assistance, we provide flexible plans to suit your project requirements.
Take a look at the lepo.co support plans
ð¤ Help us keep working on this project
Support the development of WPF UI and other innovative projects by becoming a sponsor on GitHub! Your monthly or one-time contributions help us continue to deliver high-quality, open-source solutions that empower developers worldwide.
ð Getting started
For a starter guide see our documentation.
WPF UI Gallery is a free application available in the Microsoft Store, with which you can test all functionalities.
https://apps.microsoft.com/store/detail/wpf-ui/9N9LKV8R9VGM?cid=windows-lp-hero
$ winget install 'WPF UI'
WPF UI is delivered via NuGet package manager. You can find the package here:
https://www.nuget.org/packages/wpf-ui/
Visual Studio
The plugin for Visual Studio 2022 let you easily create new projects using WPF UI.
https://marketplace.visualstudio.com/items?itemName=lepo.wpf-ui
ð· Screenshots
ðï¸ Works with Visual Studio Designer
â¤ï¸ Custom Tray icon and menu in pure WPF
â Custom Windows 11 SnapLayout available for TitleBar.
ð Documentation
Documentation can be found at https://wpfui.lepo.co/. We also have a tutorial over there for newcomers.
ð§ Development
If you want to propose a new functionality or submit a bugfix, create a Pull Request for the branch main.
ð How to use?
First, your application needs to load custom styles, add in the MyApp\App.xaml file:
<Application
...
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Dark" />
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
If your application does not have MyApp\App.xaml file, use ApplicationThemeManager.Apply(frameworkElement)
to apply/update the theme resource in the frameworkElement
.
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
ApplicationThemeManager.Apply(this);
}
}
Now you can create fantastic apps, e.g. with one button:
<ui:FluentWindow
...
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<StackPanel>
<ui:TitleBar Title="WPF UI"/>
<ui:Card Margin="8">
<ui:Button Content="Hello World" Icon="{ui:SymbolIcon Fluent24}" />
</ui:Card>
</StackPanel>
</ui:FluentWindow>
Special thanks
Crafting apps for .NET without the creators of tools like ReSharper or XAML Styler would never be such a fantastic adventure.
JetBrains was kind enough to lend a license for the open-source dotUltimate for WPF UI development. Learn more here:
Microsoft Property
Design of the interface, choice of colors and the appearance of the controls were inspired by projects made by Microsoft for Windows 11.
The Wpf.Ui.Gallery app includes icons from Microsoft WinUI 3 Gallery app. They are used here as an example of creating tools for Microsoft systems.
Segoe Fluent Icons
WPF UI uses Fluent System Icons. Although this font was also created by Microsoft, it does not contain all the icons for Windows 11. If you need the missing icons, add Segoe Fluent Icons to your application.
According to the EULA of Segoe Fluent Icons we cannot ship a copy of it with this dll. Segoe Fluent Icons is installed by default on Windows 11, but if you want these icons in an application for Windows 10 and below, you must manually add the font to your application's resources.
https://docs.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font
https://docs.microsoft.com/en-us/windows/apps/design/downloads/#fonts
In the app dictionaries, you can add an alternate path to the font
<FontFamily x:Key="SegoeFluentIcons">pack://application:,,,/;component/Fonts/#Segoe Fluent Icons</FontFamily>
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
License
WPF UI is free and open source software licensed under MIT License. You can use it in private and commercial projects.
Keep in mind that you must include a copy of the license in your project.
Top Related Projects
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
Google's Material Design in XAML & WPF, for C# & VB.Net.
Shared Controlz for WPF and ... more
All the controls missing in WPF. Over 1 million downloads.
Modern UI for WPF
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot