MaterialDesignInXamlToolkit README

The project's README from github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit. As one markdown file: README.md.

Material Design In XAML Toolkit Logo of Material Design in XAML

NuGet-Themes NuGet-Colors

NuGet-Themes-CI NuGet-Colors-CI

Backers on Open Collective Sponsors on Open Collective Chat Issues

Comprehensive and easy to use Material Design theme and control library for the Windows desktop (WPF).

See screenshots

Table of contents

Getting started

[!NOTE] See the full starting guide for more in-depth information.

This quick guide assumes you have already created a WPF project and are using Microsoft Visual Studio 2022.

Install-Package MaterialDesignThemes
<Application 
  x:Class="Example.App"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />

                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign2.Defaults.xaml" /> 
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
<Window [...]
  Style="{StaticResource MaterialDesignWindow}"
  [...] >

XML Namespaces

The toolkit exposes two XML namespaces for use in XAML:

Prefix URI Description
materialDesign http://materialdesigninxaml.net/winfx/xaml/themes Primary namespace for all public Material Design types, controls, and converters.
materialDesignInternal http://materialdesigninxaml.net/winfx/xaml/themes-internal Namespace for types in internal sub-namespaces (MaterialDesignThemes.Wpf.Internal, MaterialDesignThemes.Wpf.Converters.Internal, MaterialDesignThemes.Wpf.Behaviors.Internal).

[!WARNING] Types exposed via the materialDesignInternal namespace are considered internal implementation details and are not guaranteed to maintain backwards-compatibility between versions. Use them at your own risk.

To use the internal namespace in XAML:

<Window ...
  xmlns:materialDesignInternal="http://materialdesigninxaml.net/winfx/xaml/themes-internal">

Building the source

To build the project, following is required:

This repository also contains 3 different demo applications:

Screenshots

Material Design 3 demo app screenshots

Buttons Cards Chips Colortool Colorzones Comboboxes Datagrids Dialogs Drawer Elevation Expander Fields Fieldslineup Groupboxes Home Iconpack Lists Menustoolbars Navigationbar Navigationrail Pallete Pickers Progressindicators Ratingbar Slider Snackbar Toggles Tooltips Transitions Trees Typography

Material Design 2 demo app screenshots

[!WARNING] The screenshots below are taken from the Material Design 2 demo app. Material Design 3 is the latest version, so the UI shown here may differ from the latest design.

Screenshot of WPF Material Design 2 demo application home page Buttons Toggles Fields ComboBoxes Palette Color Tools Pickers Icons Cards Menus and Toolbars Progress Bars Dialogs Lists Tree View Sliders Chips Typography Group Box Snackbars Elevation Colorzones Datagrids Drawer Expander Fieldslineup Navigationrail NumericUpDown Ratingbar Tabs Tooltips Transitions

More examples

FAQ

Contributing

Before contributing code read the Contribution Guidelines

Want to say thanks? 🙏🏻

This project exists thanks to all the people who contribute.

Mentions

Backers

Thank you to all our backers! 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Become a sponsor.

MaterialDesignInXamlToolkit (MaterialDesignInXAML/MaterialDesignInXamlToolkit)

Searching Database…

这是什么东西?把谷歌的 Material Design 带到 WPF:一个开源的主题和控件库,面向用 C# 或 VB.Net 编写的 Windows 桌面应用。它会重新美化所有主要的 WPF 控件,并额外提供一些 Material 风格的组件。
那它是一个要安装的应用,还是加到我自己的项目里的东西?它是一个库,不是应用:你在现有的 WPF 项目里引用它,它就会给你已经在用的控件套上 Material Design 的样式,还自带一些额外的控件。
怎么把它加进 WPF 项目?通过 Visual Studio 的 NuGet 包管理器或命令行安装这个工具包,然后按照入门指南修改 App.xaml(和 MainWindow.xaml)。如果想用 Material Design 3,就使用 MaterialDesign3.Defaults.xaml。
开始之前需要先装好什么?一个 WPF 项目和 Visual Studio 2022。如果你想自己编译这个工具包的源代码,还需要安装“.NET 桌面开发”工作负载。
Material Design 3 支持现在完全成熟了吗?已经可以通过 MaterialDesign3.Defaults.xaml 使用 MD3 了,但它专属的演示应用还在开发中——Material Design 2 的演示仍然是包含全部控件的完整参考。
它只支持 Windows 吗,能不能用来做 Mac 或 Linux 应用?仅限 Windows——它基于 WPF 这个 Windows 桌面框架,所以 macOS 和 Linux 不在支持范围内。
除了美化现有的 WPF 控件,它还新增了哪些控件?卡片(Cards)、对话框(Dialogs)、时钟(Clock)和多操作按钮(Multi Action Button),外加完整的 Material Design Icons 图标包和便捷的过渡动画效果。
应用运行的时候能改配色方案吗?可以——调色板在设计时和运行时都很容易配置,遵循谷歌的 Material Design 规范。
它能和其他 WPF 界面库一起用吗?可以——它兼容 Dragablz 和 MahApps,仓库里甚至还提供了把三者结合起来的演示。底层它基于 ControlzEx 库构建。
正式采用之前,我能先看看这些控件长什么样吗?可以——源项目里就带演示应用:MaterialDesignDemo(Material Design 2 样式,包含所有控件,开发时推荐使用)和面向新样式的 MaterialDesign3Demo。
Size
79.1 MB
Stars
16.3K
Age
11y
Commits · 90 Days