MahApps.Metro
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
Top Related Projects
Shared Controlz for WPF and ... more
Google's Material Design in XAML & WPF, for C# & VB.Net.
Modern UI for WPF
Dragable and tearable tab control for WPF
All the controls missing in WPF. Over 1 million downloads.
Contains some simple and commonly used WPF controls
Quick Overview
MahApps.Metro is a toolkit for creating modern, sleek Windows Presentation Foundation (WPF) applications. It provides a set of controls, styles, and themes that allow developers to easily create applications with a Metro-inspired look and feel, similar to Windows 8 and later versions of the Windows operating system.
Pros
- Extensive set of custom controls and styles for a modern UI
- Easy integration with existing WPF applications
- Active community and regular updates
- Comprehensive documentation and examples
Cons
- Learning curve for developers new to WPF or XAML
- Some customization may require in-depth knowledge of the framework
- Potential performance impact on larger applications
- Dependency on specific .NET Framework versions
Code Examples
- Adding MahApps.Metro to your WPF application:
<Window x:Class="YourNamespace.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
Title="MainWindow" Height="450" Width="800">
<!-- Your window content here -->
</Window>
- Using a MahApps.Metro control (MetroProgressBar):
<mah:MetroProgressBar Value="75" />
- Applying a MahApps.Metro theme:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
ThemeManager.Current.ChangeTheme(this, "Light.Blue");
}
}
Getting Started
-
Install the MahApps.Metro NuGet package:
Install-Package MahApps.Metro
-
Add the following to your
App.xaml
:<Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources>
-
Change your main window to use
MetroWindow
:<mah:MetroWindow x:Class="YourNamespace.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" Title="MainWindow" Height="450" Width="800"> <!-- Your window content here --> </mah:MetroWindow>
-
Update your code-behind:
public partial class MainWindow : MetroWindow { public MainWindow() { InitializeComponent(); } }
Competitor Comparisons
Shared Controlz for WPF and ... more
Pros of ControlzEx
- Focused on providing enhanced WPF controls and behaviors
- Lightweight and modular, allowing for easy integration into existing projects
- Actively maintained with regular updates and bug fixes
Cons of ControlzEx
- Less comprehensive UI toolkit compared to MahApps.Metro
- Smaller community and fewer resources available
- May require additional styling efforts to achieve a modern look
Code Comparison
ControlzEx:
<controls:WindowChrome.WindowChrome>
<controls:WindowChrome
GlassFrameThickness="1"
CornerRadius="0"
CaptionHeight="30"/>
</controls:WindowChrome.WindowChrome>
MahApps.Metro:
<Controls:MetroWindow x:Class="MainWindow"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
GlowBrush="{DynamicResource AccentColorBrush}"
BorderThickness="1"
WindowStartupLocation="CenterScreen">
</Controls:MetroWindow>
ControlzEx focuses on enhancing specific WPF controls, while MahApps.Metro provides a complete UI toolkit with pre-styled controls. ControlzEx offers more flexibility for customization, but MahApps.Metro provides a more cohesive and polished look out of the box. The choice between the two depends on project requirements and desired level of customization.
Google's Material Design in XAML & WPF, for C# & VB.Net.
Pros of MaterialDesignInXamlToolkit
- Follows Google's Material Design guidelines more closely
- Offers a wider range of UI components and controls
- Provides more customization options for theming and styling
Cons of MaterialDesignInXamlToolkit
- Steeper learning curve due to more complex implementation
- May require more resources and potentially impact performance
- Less native Windows look and feel compared to MahApps.Metro
Code Comparison
MaterialDesignInXamlToolkit:
<materialDesign:Card Padding="32" Margin="16">
<TextBlock Style="{DynamicResource MaterialDesignHeadline6TextBlock}">
Hello World
</TextBlock>
</materialDesign:Card>
MahApps.Metro:
<Controls:MetroContentControl>
<TextBlock Style="{DynamicResource MahApps.Styles.TextBlock.Heading6}">
Hello World
</TextBlock>
</Controls:MetroContentControl>
Both libraries offer modern UI components for WPF applications, but MaterialDesignInXamlToolkit adheres more strictly to Material Design principles, while MahApps.Metro provides a blend of Metro and modern styles. The choice between them depends on the desired look and feel, performance requirements, and the developer's familiarity with Material Design concepts.
Modern UI for WPF
Pros of MUI
- Lightweight and minimalistic design, focusing on core Modern UI principles
- Easier to customize and extend due to its simpler architecture
- Better suited for applications requiring a more native Windows look and feel
Cons of MUI
- Less comprehensive feature set compared to MahApps.Metro
- Smaller community and fewer third-party contributions
- Less frequent updates and maintenance
Code Comparison
MUI:
<mui:ModernWindow x:Class="MainWindow"
xmlns:mui="http://firstfloorsoftware.com/ModernUI"
Title="MUI Example" Style="{StaticResource BlankWindow}">
<Grid>
<TextBlock Text="Hello, Modern UI!" />
</Grid>
</mui:ModernWindow>
MahApps.Metro:
<mah:MetroWindow x:Class="MainWindow"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
Title="MahApps.Metro Example" TitleCharacterCasing="Normal">
<Grid>
<TextBlock Text="Hello, MahApps.Metro!" />
</Grid>
</mah:MetroWindow>
Both libraries offer modern UI elements for WPF applications, but MahApps.Metro provides a more extensive set of controls and features. MUI focuses on simplicity and a native Windows look, while MahApps.Metro offers more customization options and a larger community. The choice between the two depends on the specific requirements of your project and the desired level of customization and support.
Dragable and tearable tab control for WPF
Pros of Dragablz
- Specialized in creating draggable and dockable tab controls
- Lightweight and focused on a specific set of UI functionalities
- Easier to integrate into existing projects without major UI overhauls
Cons of Dragablz
- Limited scope compared to MahApps.Metro's comprehensive UI toolkit
- Smaller community and potentially less frequent updates
- May require additional libraries for a complete modern UI experience
Code Comparison
MahApps.Metro:
<Controls:MetroWindow x:Class="MainWindow"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="MahApps.Metro Window" Height="600" Width="800">
<!-- Window content -->
</Controls:MetroWindow>
Dragablz:
<dragablz:TabablzControl>
<dragablz:TabablzControl.InterTabController>
<dragablz:InterTabController />
</dragablz:TabablzControl.InterTabController>
<!-- Tab items -->
</dragablz:TabablzControl>
MahApps.Metro offers a complete UI toolkit with modern Windows styling, while Dragablz focuses on providing advanced tab control functionality. MahApps.Metro is better suited for full application UI overhauls, whereas Dragablz excels in scenarios requiring flexible and interactive tab layouts. The choice between the two depends on the specific needs of your project and the desired level of UI customization.
All the controls missing in WPF. Over 1 million downloads.
Pros of WPF Toolkit
- More extensive collection of controls and components
- Longer history and established reputation in the WPF community
- Includes advanced data visualization tools like charts and graphs
Cons of WPF Toolkit
- Commercial license required for some features
- Less focus on modern, flat UI design
- Steeper learning curve due to the large number of components
Code Comparison
MahApps.Metro:
<Controls:MetroWindow x:Class="MainWindow"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="Metro Window" Height="600" Width="800">
<Controls:MetroWindow.RightWindowCommands>
<Controls:WindowCommands>
<Button Content="Settings" />
</Controls:WindowCommands>
</Controls:MetroWindow.RightWindowCommands>
</Controls:MetroWindow>
WPF Toolkit:
<xctk:Wizard x:Name="Wizard" FinishButtonClosesWindow="True">
<xctk:WizardPage x:Name="Page1" Title="Page 1" Description="This is page 1.">
<TextBlock Text="Welcome to the Wizard!" />
</xctk:WizardPage>
<xctk:WizardPage x:Name="Page2" Title="Page 2" Description="This is page 2.">
<TextBlock Text="Almost done!" />
</xctk:WizardPage>
</xctk:Wizard>
Both libraries offer unique features and controls for WPF development. MahApps.Metro focuses on modern UI design with a Metro-style look, while WPF Toolkit provides a broader range of controls and components for various application needs.
Contains some simple and commonly used WPF controls
Pros of HandyControl
- More comprehensive set of controls and features
- Modern and sleek design aesthetic
- Active development with frequent updates
Cons of HandyControl
- Less documentation and community support
- Steeper learning curve for beginners
- Potentially more complex implementation for simple projects
Code Comparison
HandyControl:
<hc:Window x:Class="MainWindow"
xmlns:hc="https://handyorg.github.io/handycontrol">
<hc:SimplePanel>
<hc:Button Content="Click Me" Style="{StaticResource ButtonPrimary}"/>
</hc:SimplePanel>
</hc:Window>
MahApps.Metro:
<Controls:MetroWindow x:Class="MainWindow"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls">
<Grid>
<Button Content="Click Me" Style="{StaticResource MahApps.Styles.Button.Square}"/>
</Grid>
</Controls:MetroWindow>
Both libraries offer modern UI controls for WPF applications, but HandyControl provides a wider range of components with a more contemporary look. However, MahApps.Metro has been around longer and has more extensive documentation and community support. The code comparison shows that both libraries use custom namespaces and styles, with HandyControl using a slightly different approach to layout and styling.
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

MahApps.Metro
A toolkit for creating awesome WPF applications. Lots of goodness out-of-the box.
Supporting .NET Framework 4.6.2 and greater, .NET Core 3.1, .NET 5 and .NET 6 (on Windows)
Let's get started
- Documentation
- Quick Start
- Icons (MahApps.Metro.IconPacks)
- Contributing to MahApps.Metro
- Building the MahApps.Metro solution
- Releases and Release Notes
- Visual Studio Templates
- Wiki
Get in touch
License
Copyright © .NET Foundation, Jan Karger, Brendan Forster, Dennis Daume, Alex Mitchell, Paul Jenkins and contributors.
MahApps.Metro is provided as-is under the MIT license. For more information see LICENSE.
Code of Conduct
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.
Contribution License Agreement
By signing the CLA, the community is free to use your contribution to .NET Foundation projects.
.NET Foundation
This project is supported by the .NET Foundation.
Dev Tools
We want to give some :heart: to this dev tools which makes the work a little bit easier!
- Cake (C# Make) a free and open source cross-platform build automation system.
- ReSharper
- Rider
- AppVeyor CI/CD service for Windows, Linux and macOS
A big thank goes to JetBrains who provide an Open Source License for ReSharper and Rider.
Contributors
A big virtual hug :hugs: goes to all the great people around the world who contributed to this project!
Awesome Application Samples
- Showcase/Demo application The showcase/demo application built by the MahApps.Metro team. Compiled versions can be downloaded from releases and preview versions can be downloaded from CI artifacts
- Azuser by @Inzanit Azure SQL Server User Management
- Carnac by @Code52 the Magnificent Keyboard Utility
- Certify The Web by @webprofusion The GUI to manage free certificates from Let's Encrypt
- Chocolatey GUI Chocolatey GUI is a user interface for Chocolatey (a Machine Package Manager for Windows)
- CodeTrack by Nico Van Goethem CodeTrack is a versatile profiler with some extra tricks up its sleeve.
- FolderSecurityViewer Easy to use NTFS permissions reporter to get all effective security owners of your data
- Hearthstone-Deck-Tracker by @Epix37 HDT is an automatic deck tracker and manager for Hearthstone
- Markdown Edit by @mike-ward A full-featured Markdown editor for Windows with an emphasis on content and keyboard shortcuts
- Markdown Monster by @RickStrahl An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
- MarkPad (DownmarkerWPF) by @Code52 a visual Markdown editor
- Modern UI for WPF (MUI) Inspired by MahApps.Metro
- NETworkManager by @BornToBeRoot A powerful tool for managing networks and troubleshoot network problems!
- Papercut by @Jaben Simple Desktop SMTP Server / Email Receiver
- RainyDay Backup Backup system for Azure DevOps Services and Azure Devops Server
- SimpleMP by @punker76 Simple Music Player - SimpleMP - Keeps it simple and plays your music
- Solutionizer by @thoemmi Creating ad-hoc solutions for Visual Studio
- Version Changer Version Changer is a Visual Studio extension that makes it simple to change the version numbers of all the projects in a solution.
- WinReform by @AKruimink A simple tool to help resize and relocate stubborn windows.
- Xamarin Inspector Visualize and debug your live app
- Xamarin Workbooks Xamarin Workbooks provide a blend of documentation and code that is perfect for experimentation, learning, and creating guides and teaching aids.
Something missing?
If you're looking for other awesome libraries which are compatible with MahApps, check them out:
- MaterialDesignInXamlToolkit Comprehensive and easy to use Material Design theme and control library for the Windows desktop. http://materialdesigninxaml.net
- Fluent.Ribbon made by @batzen a library that implements an Office-like user interface for the Windows Presentation Foundation (WPF).
- MahApps.Metro.SimpleChildWindow A simple child window for MahApps.Metro.
- LoadingIndicators.WPF made by @zeluisping
- Dragablz Tearable tab control for WPF, which includes docking, tool windows and MDI. http://dragablz.net
Sponsoring
This framework is free and can be used for free, open source and commercial applications. MahApps.Metro (all code, NuGets and binaries) are under the MIT License (MIT). It's tested, used and contributed by many awesome people. So hit the magic :star: button, we appreciate it!!! :pray:
The core team member(s), MahApps.Metro contributors and contributors in the ecosystem do this open source work in their free time. If you use MahApps.Metro a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity/usability too.
Become a sponsor and show your support to this open source project.
:pray: All OpenCollective Backers (archived) :heart:
Screenshots








Top Related Projects
Shared Controlz for WPF and ... more
Google's Material Design in XAML & WPF, for C# & VB.Net.
Modern UI for WPF
Dragable and tearable tab control for WPF
All the controls missing in WPF. Over 1 million downloads.
Contains some simple and commonly used WPF controls
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