經過 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" [...] >