当前位置: 欣欣网 > 码农

一款让你爱不释手的现代化.NET UI框架

2024-01-27码农

概述

今天给大家介绍一款十分漂亮的UI(Modern UI for WPF), 这个界面控件库不仅开源免费,而且美观简洁,真的是像他的名字描述的一样,是一款现代化的UI,如果想让自己的项目高大上又不想自己造轮子,使用它是一个不二的选择。下来跟着小编一起来认识学习这款UI库吧!


github下载链接:

https://github.com/firstfloorsoftware/mui

主要特征:

  • 外观,可在运行时配置

  • 深色、浅色和自定义主题

  • 主题色

  • 大字体和小字体

  • 新的现代控件

  • BBCodeBlock的

  • 现代按钮

  • 新式对话

  • 现代框架

  • 现代菜单

  • ModernProgressRing(具有 8 种内置样式)

  • 新式选项卡

  • ModernToggleButton

  • 新式窗口

  • RelativeAnimatingContentControl

  • TransitioningContentControl

  • 布局

  • 一组预定义的页面布局,用于保持一致的外观和感觉

  • 控件样式

  • 常见 WPF 控件的样式,如 Button、TextBlock 等。

  • 所有样式都会自动调整深色和浅色主题,并在适当的情况下使用强调色

  • 可定制的导航框架

  • ILinkNavigator 和 IContentLoader 接口,实现最大的灵活性

  • ModernFrame 中的内容加载器异常模板

  • 控件展示

    Button/Checkbox/Radiobutton:

    DataGrid:

    Date:Calendar&Datepicker

    Itemscontrol;combobox&contextmenu&listbox&Listview&Treeview

    ProgressBar:

    Slider:

    Text:

    Sample form:

    Moderndialog:

    MessageBox:

    Modernprogressring:

    Modernwindow:

    具体用法

    第一步:NUGET上引用dll:

    第二步:APP.XAML

    <ResourceDictionary><ResourceDictionary.MergedDictionaries><ResourceDictionarySource="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml" /><ResourceDictionarySource="/FirstFloor.ModernUI;component/Assets/ModernUI.Light.xaml"/></ResourceDictionary.MergedDictionaries></ResourceDictionary>

    第三步;UserControl.Xaml引用moderui

    xmlns:mui="http://firstfloorsoftware.com/ModernUI"

    全部代码:

    <UserControlx: class="WpfApp18.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:mui="http://firstfloorsoftware.com/ModernUI"xmlns:local="clr-namespace:WpfApp18"mc:Ignorable="d"d:DesignHeight="300"d:DesignWidth="300"><Grid><StackPanelMinWidth="200"HorizontalAlignment="Left"><TextBlockText="MODERNPROGRESSRING" style="{StaticResource Heading2}"Margin="0,0,0,8" /><mui:BBCodeBlockBBCode="Represents a control that indicates that an operation is ongoing. The control comes with 8 built-in spinner styles, ported from [url=https://github.com/nigel-sampson/spinkit-xaml]SpinKit.Xaml[/url]."Margin="0,0,0,8" /><mui:BBCodeBlockBBCode="Note: the styles automatically fill the given control size, except for [i]Wandering Cubes[/i] which is hard coded for 80 x 80."Margin="0,0,0,16" /><StackPanelOrientation="Horizontal"Margin="0,0,0,32"><TextBlockText=" style:"VerticalAlignment="Center" /><ComboBoxx:Name="CmbRing style"Margin="8,0,0,0"><ComboBoxItemContent="Chasing Dots"Tag="{StaticResource ChasingDotsProgressRing style}" /><ComboBoxItemContent="Circle (default style)"IsSelected="True"Tag="{StaticResource CircleProgressRing style}" /><ComboBoxItemContent="Double Bounce"Tag="{StaticResource DoubleBounceProgressRing style}" /><ComboBoxItemContent="Pulse"Tag="{StaticResource PulseProgressRing style}" /><ComboBoxItemContent="Rotating Plane"Tag="{StaticResource RotatingPlaneProgressRing style}" /><ComboBoxItemContent="Three Bounce"Tag="{StaticResource ThreeBounceProgressRing style}" /><ComboBoxItemContent="Wandering Cubes"Tag="{StaticResource WanderingCubesProgressRing style}" /><ComboBoxItemContent="Wave"Tag="{StaticResource WaveProgressRing style}" /></ComboBox></StackPanel><mui:ModernProgressRingIsActive="True"Width="80"Height="80" style="{Binding SelectedItem.Tag, ElementName=CmbRing style}" /></StackPanel></Grid></UserControl>

    效果演示

    源码下载

    链接:https://pan.baidu.com/s/1H8DdeymCKM6pOH2yohHUtw

    提取码:6666

    技术群:添加小编微信并备注进群小编微信:mm1552923 公众号:Dotnet讲堂