WPFDevelopers:成熟的UI工具库
背景
在研究prism导航的时候发现了这个UI控件库,很有质感。加入博客收藏。
核心亮点
优雅的界面设计:控件样式美观,主题切换灵活,可以轻松融入各种应用风格。
丰富的交互效果:包括GrayscaleEffect(灰度效果)、CropImage(图片裁剪)以及动态加载提示等,为用户提供生动的视觉体验。
强大的功能性组件:如Message提示框、Badge标签、MultiSelectComboBox等,满足多样化的需求。
案例
MainWindow.xaml
<wd:Window
x:Class="WpfPrismNavigation.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
xmlns:vm="clr-namespace:WpfPrismNavigation.ViewModels"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
Title="Prism - Navigation"
Width="800"
Height="450"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<wd:DrawerMenu SelectedItem="{Binding SelectedItem}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" CommandParameter="" />
</i:EventTrigger>
</i:Interaction.Triggers>
<wd:DrawerMenuItem Text="Home">
<wd:DrawerMenuItem.Icon>
<wd:PathIcon Kind="Home" />
</wd:DrawerMenuItem.Icon>
</wd:DrawerMenuItem>
<wd:DrawerMenuItem Text="Edge">
<wd:DrawerMenuItem.Icon>
<wd:PathIcon Data="M511.949 40.96c-260.147 0-470.989 210.893-470.989 471.091 0 260.096 210.842 470.989 470.989 470.989s471.040-210.893 471.040-470.989c0-260.198-210.893-471.091-471.040-471.091zM512 665.651c-84.838 0-153.6-68.813-153.6-153.6s68.762-153.6 153.6-153.6c84.787 0 153.6 68.813 153.6 153.6s-68.813 153.6-153.6 153.6z" />
</wd:DrawerMenuItem.Icon>
</wd:DrawerMenuItem>
</wd:DrawerMenu>
<ContentControl Grid.Column="1" prism:RegionManager.RegionName="ContentRegion" />
</Grid>
</wd:Window>
using System.Windows;
namespace WpfPrismNavigation.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
}
}
App.xaml
<prism:PrismApplication
x:Class="WpfPrismNavigation.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfPrismNavigation"
xmlns:prism="http://prismlibrary.com/"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Light.Blue.xaml" />
<!-- 需要注意 wd:Resources 必须在配色主题后,Theme="Dark" 为黑色皮肤 -->
<wd:Resources Theme="Dark" />
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</prism:PrismApplication>
代码
参考文章:
原文链接:https://github.com/yanjinhuagood/WpfPrismNavigation
码云链接:https://gitee.com/yanjinhua/WpfPrismNavigation
争取早日换一个好的工作。