介绍几款WPF应用的UI库

在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>

本文作者:孤沉

本文链接:https://www.cnblogs.com/guchen33/p/17631582.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   孤沉  阅读(266)  评论(1编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
展开