经过 NuGet 包管理器搜索自动安装bash
经过 NuGet 包管理器控制台手动安装app
Install-Package MaterialDesignThemes
主题code
对于 Light 主题(二选一):component
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignThemes.Wpf; component / Themes / MaterialDesignTheme.Light.xaml ” />
对于 Dark 主题(二选一):io
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignThemes.Wpf; component / Themes / MaterialDesignTheme.Dark.xaml ” />
默认class
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignThemes.Wpf; component / Themes / MaterialDesignTheme.Defaults.xaml ” />
颜色基础
< ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignColors; component / Themes / Recommended / Primary / MaterialDesignColor.COLOR_NAME.xaml ” /> < ResourceDictionary Source = “ pack:// application:,,, / MaterialDesignColors; component / Themes / Recommended / Accent / MaterialDesignColor.COLOR_NAME.xaml ” />
基础配置配置
<Window [...] TextElement.Foreground="{DynamicResource MaterialDesignBody}" Background="{DynamicResource MaterialDesignPaper}" [...] >
完整配置material-design
<Window [...] TextElement.Foreground="{DynamicResource MaterialDesignBody}" Background="{DynamicResource MaterialDesignPaper}" TextElement.FontWeight="Medium" TextElement.FontSize="14" FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto" [...] >