當前位置: 妍妍網 > 碼農

一款讓你愛不釋手的現代化.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講堂