Bài viết
Kho tài liệu và bài viết được chia sẻ, đánh giá bởi cộng đồng
Add Material Design vào ứng dụng WPF
Nội dung bài viết
Cài đặt
Vào Tools -> Nuget Package Manager -> Package Manager Console -> gõ dòng lệnh
Install-Package MaterialDesignThemes
Sử dụng
Vào App.xaml, gõ đoạn code sau
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
Trở lại với MainWindow.xaml, add dòng lệnh này vào
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
Nội dung bài viết