WPF-Controls | English
https://referencesource.microsoft.com/?wt.mc_id=MVP_380318
Release 下载地址 https://github.com/HeBianGu/WPF-ControlBase/releases
https://github.com/HeBianGu/WPF-ControlBase/wiki
HeBianGu.Demo.Demo1
HeBianGu.Demo.Demo2
<Button Style="{DynamicResource {x:Static h:ButtonKeys.Accent}}" />
HeBianGu.Demo.Demo3
<Button Background="{DynamicResource {x:Static h:BrushKeys.BackgroundDefault}}"/>
HeBianGu.Demo.Demo4
// Do :继承ApplicationBase
public partial class App : ApplicationBase
{
}
// Do :继承h:MainWindow
<h:MainWindow x:Class="HeBianGu.Demo.Demo4.MainWindow"
HeBianGu.Demo.Demo5
// Do :注册窗口配置,注册后窗口右侧有可设置主题的按钮
services.AddTheme();
// Do :注册序列化保存接口,注册后主题的配置会保存到本地,再次启动会读取
services.AddXmlSerialize();
// Do:设置默认主题
app.UseLocalTheme(l =>
{
l.AccentColor = (Color)ColorConverter.ConvertFromString("#FF0093FF");
l.SmallFontSize = 14D;
l.LargeFontSize = 16D;
l.FontSize = FontSize.Small;
l.ItemHeight = 36;
l.RowHeight = 40;
l.ItemCornerRadius = 5;
l.AnimalSpeed = 5000;
l.AccentColorSelectType = 0;
l.IsUseAnimal = false;
l.ThemeType = ThemeType.Light;
l.Language = Language.Chinese;
l.AccentBrushType = AccentBrushType.LinearGradientBrush;
});
HeBianGu.Demo.Demo6
// Do :注册后可以使用框架自带的对话框
services.AddMessageDialog();
HeBianGu.Demo.Demo7
// Do :注册配置加载方式
services.AddSetting();
// Do :注册右上角配置页面
services.AddSettingViewPrenter();
// Do :添加自定义配置信息
app.UseSetting(l =>
{
l.Settings.Add(TestSetting.Instance);
});
HeBianGu.Demo.Demo8
// Do :注册启动页面
services.AddStart();
// Do :添加启动窗口配置
app.UseStart(l =>
{
l.Title = "HeBianGu";
l.TitleFontSize = 80;
});
HeBianGu.Demo.Demo9
// Do :注册登录页面和使用测试接口
services.AddIdentity();
// Do :添加身份认证配置
app.UseIdentity(l =>
{
});
HeBianGu.Demo.Demo10
// Do :注册软件更新页面
services.AddUpgrade();
// Do :添加软件更新配置
app.UseUpgrade(l =>
{
});
其他示例待更新...
目前大部分功能采用注入(Add)和配置(Use)的方式添加
系统提供默认方法,如:services.AddMessageDialog(),如果不想使用系统默认对话框则替换成注册方法,重新注册接口即可,如:service.AddSingleton<IMessageDialog, YouMessageDialog>(),其中YouMessageDialog是你要自己实现的对话框,其他功能思想类似;
配置使用如:UseStart(l=>l.Title="HeBianGu")自定义要显示的内容,通过此方式配置的信息都有保存在主窗口右上角的设置按钮的页面中,可以自定义配置和序列化保存在本地;
VS=>项目=>导出模板
HeBianGu.Template.Main
HeBianGu.Template.Link
https://blog.csdn.net/u010975589?type=blog
https://space.bilibili.com/370266611
https://github.com/HeBianGu/WPF-Control
QQ:908293466