Skip to content

Anonymy/WPF-ControlBase

 
 

Repository files navigation

WPF-Controls | English

dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version dotnet-version

csharp-version IDE-version

nuget-version Github-build-status

关于

Star

Stargazers over time

预览

案例

Creator

Map

Chart

Office

qrcode

Disk

qrcode

Scene

qrcode

Manager

Menu

Above

Blur

Blur

Tool

Touch

Repository

Main

基础控件

Button

TextBox

CheckBox

RadioButton

ToggleButton

ComboBox

DatePicker

Slider

ProgressBar

Expander

ListBox

DataGrid

TreeView

TabControl

ContextMenu

Menu

Label

TextBlock

ToolTip

自定义控件

PropertyGrid

Chart2D

Diagram

Drawer

Explorer

ExplorerTree

FilterBox

FilterColumn

SearchBox

SelectionBox

GridSplitter

Guide

ImagePlayer

AnimationBox

AnimatedTabControl

LeftMenu

Host

Message

MessageContainer

MessageListBox

MultiComboBox

PagedDataGrid

Panel

PasswordBox

Ping

ScrollInto

ScrollVewerLocator

SearchComboBox

Shape

Shuttle

StoryBoard

TextEditor

ThemeSet

ToggleExpander

TopContainer

TransformAdorner

TreeListView

Vlc

自定义窗口

Blur

Float

Link

Login

Main

Menu

MessageDialog

Notify

Ribbon

Start

特性

Identity

Setting

Repository

Upgrade

XmlSerialize

Project

Operation

License

Component

Automation

Module

Mvc

Mvp

Image

Validation

ViewModel

Animation

MarkupExtension

AppConfig

Command

Converter

Interactivity

TypeConverter

使用

示例

这是一个最简单的使用方式示例

HeBianGu.Demo.Demo1

这是一个基础控件中的ResourceKey示例

HeBianGu.Demo.Demo2

        <Button Style="{DynamicResource {x:Static h:ButtonKeys.Accent}}" />

这是一个公用基础的ResourceKey示例

HeBianGu.Demo.Demo3

        <Button Background="{DynamicResource {x:Static h:BrushKeys.BackgroundDefault}}"/>

这是一个最简单的MainWindow窗口示例

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)的方式添加

Add

系统提供默认方法,如:services.AddMessageDialog(),如果不想使用系统默认对话框则替换成注册方法,重新注册接口即可,如:service.AddSingleton<IMessageDialog, YouMessageDialog>(),其中YouMessageDialog是你要自己实现的对话框,其他功能思想类似;

Use

配置使用如:UseStart(l=>l.Title="HeBianGu")自定义要显示的内容,通过此方式配置的信息都有保存在主窗口右上角的设置按钮的页面中,可以自定义配置和序列化保存在本地;

模板

VS=>项目=>导出模板

Main

HeBianGu.Template.Main

Link

HeBianGu.Template.Link

NuGet包

名称 NuGet
HeBianGu.Base.WpfBase NuGet
HeBianGu.General.WpfControlLib NuGet
HeBianGu.Service.Animation NuGet
HeBianGu.Service.AppConfig NuGet
HeBianGu.Service.Converter NuGet
HeBianGu.Service.License NuGet
HeBianGu.Service.MarkupExtension NuGet
HeBianGu.Service.Mvc NuGet
HeBianGu.Service.Mvp NuGet
HeBianGu.Service.TypeConverter NuGet
HeBianGu.Service.Validation NuGet
HeBianGu.Service.Image NuGet
HeBianGu.Common.Expression NuGet
HeBianGu.Control.Adorner NuGet
HeBianGu.Control.Chart2D NuGet
HeBianGu.Control.Diagram NuGet
HeBianGu.Control.Drawer NuGet
HeBianGu.Control.Explorer NuGet
HeBianGu.Control.Filter NuGet
HeBianGu.Control.GridSplitter NuGet
HeBianGu.Control.ImagePlayer NuGet
HeBianGu.Control.LeftMenu NuGet
HeBianGu.Control.Host NuGet
HeBianGu.Control.Message NuGet
HeBianGu.Control.MessageContainer NuGet
HeBianGu.Control.MessageListBox NuGet
HeBianGu.Control.MultiComboBox NuGet
HeBianGu.Control.PagedDataGrid NuGet
HeBianGu.Control.Panel NuGet
HeBianGu.Control.PasswordBox NuGet
HeBianGu.Control.Ping NuGet
HeBianGu.Control.PropertyGrid NuGet
HeBianGu.Control.ScrollInto NuGet
HeBianGu.Control.ScrollVewerLocator NuGet
HeBianGu.Control.Shape NuGet
HeBianGu.Control.Shuttle NuGet
HeBianGu.Control.Step NuGet
HeBianGu.Control.StoryBoard NuGet
HeBianGu.Control.ThemeSet NuGet
HeBianGu.Control.ToggleExpander NuGet
HeBianGu.Control.TopContainer NuGet
HeBianGu.Control.TreeListView NuGet
HeBianGu.Control.Vlc NuGet
HeBianGu.Window.Blur NuGet
HeBianGu.Window.Float NuGet
HeBianGu.Window.Link NuGet
HeBianGu.Window.Login NuGet
HeBianGu.Window.Menu NuGet
HeBianGu.Window.Message NuGet
HeBianGu.Window.MessageDialog NuGet
HeBianGu.Window.Notify NuGet
HeBianGu.Window.Start NuGet
HeBianGu.Systems.Component NuGet
HeBianGu.Systems.Identity NuGet
HeBianGu.Systems.Project NuGet
HeBianGu.Systems.Repository NuGet
HeBianGu.Systems.Setting NuGet
HeBianGu.Systems.Upgrade NuGet
HeBianGu.Systems.XmlSerialize NuGet

作者

赞助支持

支付宝

微信

博客

https://blog.csdn.net/u010975589?type=blog

https://space.bilibili.com/370266611

QQ:908293466

About

Wpf封装的自定义控件资源库

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%