国外美容网站,个人可以做哪些有意思的网站,网站搬家教程,网页制作与网站开发从入门到精通 下载HandyControl介绍
HandyControl是一个开源的WPF#xff08;Windows Presentation Foundation#xff09;控件库#xff0c;旨在简化WPF应用程序的开发过程并提高用户界面的美观程度和易用性。它提供了丰富的控件、样式和模板#xff0c;可以帮助开发人员快速构建出现代化的…HandyControl介绍
HandyControl是一个开源的WPFWindows Presentation Foundation控件库旨在简化WPF应用程序的开发过程并提高用户界面的美观程度和易用性。它提供了丰富的控件、样式和模板可以帮助开发人员快速构建出现代化的桌面应用程序。 查看HandyControl控件效果
从Github上克隆好源码后如下所示 进入src文件夹如下所示 Net_GE45的意思是.NET版本大于等于4.5
打开解决方案如果要启动示例查看控件效果请将HandyControlDemo_[指定的项目类型]作为启动项。
本例将HandyControlDemo_Net_GE45作为启动项。 之后当你想查看HandyControl控件的效果时可以打开下图中的应用程序 使用HandyControl控件
创建WPF项目安装HandyControl 在App.xaml中添加以下代码
Application.ResourcesResourceDictionaryResourceDictionary.MergedDictionariesResourceDictionary Sourcepack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml/ResourceDictionary Sourcepack://application:,,,/HandyControl;component/Themes/Theme.xaml//ResourceDictionary.MergedDictionaries/ResourceDictionary
/Application.Resources添加命名空间xmlns:hchttps://handyorg.github.io/handycontrol
现在以Button按钮控件与Growl 信息通知这个控件的使用为例。
xaml如下所示
Window x:ClassHandyControlTest.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:hchttps://handyorg.github.io/handycontrolxmlns:localclr-namespace:HandyControlTestmc:IgnorabledTitleMainWindow Height450 Width800GridButton Style{StaticResource ButtonPrimary} Content点击显示通知ClickButton_Click/ScrollViewer VerticalScrollBarVisibilityHidden HorizontalAlignmentRightStackPanel hc:Growl.GrowlParentTrue VerticalAlignmentTop Margin0,10,10,10//ScrollViewer/Grid
/Windowcs如下
using HandyControl.Controls;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;namespace HandyControlTest
{/// summary/// Interaction logic for MainWindow.xaml/// /summarypublic partial class MainWindow : System.Windows.Window{public MainWindow(){InitializeComponent();}private void Button_Click(object sender, RoutedEventArgs e){Growl.Success(显示一条通知);}}
}实现效果如下所示 最后
HandyControl有很多控件大家可以根据项目需要实现的效果按需使用使用时可以查看Demo的效果然后去HandyControl的官网查看用法。
HandyControl官网地址https://handyorg.github.io/