在WPF中对于前端页面的书写,我们有现成的UI类库,不需要我们自己再去写
我这里介绍几款
1、MahApps
官网
https://mahapps.com/
使用,在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>
主界面引入
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
修改MainWindow为mah:MetroWindow
2、MaterialDesign
官网
http://materialdesigninxaml.net/
App.xaml引入
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
使用,在App.xaml中添加
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<md:BundledTheme
BaseTheme="Light"
PrimaryColor="LightGreen"
SecondaryColor="Lime" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
3、HandyOrg
https://handyorg.gitee.io/handycontrol/
使用,在App.xaml中添加
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
4、LayUI
官网没有Gitee
https://gitee.com/ywk1916b/Layui-WPF
使用,在App.xaml添加
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/LayUI.Wpf;component/Themes/Default.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
标签:http,App,UI,https,WPF,官网,几款,xaml
From: https://www.cnblogs.com/guchen33/p/17631582.html