diff --git a/Installers/VS2019/HandyControl_VS2019/License.txt b/Installers/VS2019/HandyControl_VS2019/License.txt index cfef606b..0c1c18de 100644 --- a/Installers/VS2019/HandyControl_VS2019/License.txt +++ b/Installers/VS2019/HandyControl_VS2019/License.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2019 HandyOrg +Copyright (c) 2018-2020 HandyOrg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Installers/VS2019/HandyControl_VS2019/Properties/AssemblyInfo.cs b/Installers/VS2019/HandyControl_VS2019/Properties/AssemblyInfo.cs index b5f325ba..94d87828 100644 --- a/Installers/VS2019/HandyControl_VS2019/Properties/AssemblyInfo.cs +++ b/Installers/VS2019/HandyControl_VS2019/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HandyControl_VS2019")] -[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2019")] +[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Installers/VS2019/HandyControl_VS2019/source.extension.vsixmanifest b/Installers/VS2019/HandyControl_VS2019/source.extension.vsixmanifest index 6824b141..c25560c3 100644 --- a/Installers/VS2019/HandyControl_VS2019/source.extension.vsixmanifest +++ b/Installers/VS2019/HandyControl_VS2019/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + HandyControl for VS2019 This VSIX Project will help people initialize a HandyControl project. https://handyorg.github.io/handycontrol diff --git a/Installers/VS2019/WpfApp/ProjectTemplate.csproj b/Installers/VS2019/WpfApp/ProjectTemplate.csproj index d8a830db..cf36f37a 100644 --- a/Installers/VS2019/WpfApp/ProjectTemplate.csproj +++ b/Installers/VS2019/WpfApp/ProjectTemplate.csproj @@ -34,8 +34,8 @@ 4 - - ..\packages\HandyControl.2.3.0\lib\net47\HandyControl.dll + + ..\packages\HandyControl.2.4.0\lib\net47\HandyControl.dll diff --git a/Installers/VS2019/WpfApp/Properties/AssemblyInfo.cs b/Installers/VS2019/WpfApp/Properties/AssemblyInfo.cs index b45d8c50..59f278ed 100644 --- a/Installers/VS2019/WpfApp/Properties/AssemblyInfo.cs +++ b/Installers/VS2019/WpfApp/Properties/AssemblyInfo.cs @@ -6,9 +6,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HandyControl_VS2019_WpfApp")] -[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2019")] +[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("2.3.0")] -[assembly: AssemblyFileVersion("2.3.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.4.0")] +[assembly: AssemblyFileVersion("2.4.0")] diff --git a/Installers/VS2019/WpfApp/packages.config b/Installers/VS2019/WpfApp/packages.config index 4889bb7d..a1fd738f 100644 --- a/Installers/VS2019/WpfApp/packages.config +++ b/Installers/VS2019/WpfApp/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Installers/VS2019/WpfCoreApp/ProjectTemplate.csproj b/Installers/VS2019/WpfCoreApp/ProjectTemplate.csproj index c453863b..18af215f 100644 --- a/Installers/VS2019/WpfCoreApp/ProjectTemplate.csproj +++ b/Installers/VS2019/WpfCoreApp/ProjectTemplate.csproj @@ -7,7 +7,7 @@ $safeprojectname$ 1.0.0.0 Debug;Release - Copyright © $username$ 2018-2019 + Copyright © $username$ 2018-2020 1.0.0.0 1.0.0.0 latest @@ -19,6 +19,6 @@ TRACE;Core - + \ No newline at end of file diff --git a/Installers/VS2019/WpfCoreApp/Properties/AssemblyInfo.cs b/Installers/VS2019/WpfCoreApp/Properties/AssemblyInfo.cs index afd74fb0..c0e4b299 100644 --- a/Installers/VS2019/WpfCoreApp/Properties/AssemblyInfo.cs +++ b/Installers/VS2019/WpfCoreApp/Properties/AssemblyInfo.cs @@ -6,9 +6,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HandyControl_VS2019_WpfCoreApp")] -[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2019")] +[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("2.3.0")] -[assembly: AssemblyFileVersion("2.3.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.4.0")] +[assembly: AssemblyFileVersion("2.4.0")] diff --git a/LICENSE b/LICENSE index f9f0dead..3d3d568c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2019 HandyOrg +Copyright (c) 2018-2020 HandyOrg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index c2ae3353..2faaf251 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ + + ## Backers @@ -46,6 +48,11 @@ + + + + + ## Special thanks to @@ -91,6 +98,36 @@ Step 4:enjoy coding ## Latest examples +### Screenshot + +![Screenshot](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Screenshot.png) + +### GooeyEffect + +![GooeyEffect](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/GooeyEffect.gif) + +### GlowWindow + +![GlowWindow](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/GlowWindow.png) + +### FlowDocumentScrollViewerStyle + +![FlowDocumentScrollViewerStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FlowDocumentScrollViewer.png) + +### PinBox + +![PinBox](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/PinBox.png) + +## History publication + +### Effects + +![Effects](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Effects.png) + +### RelativePanel + +![RelativePanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RelativePanel.png) + ### Drawer ![Drawer](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Drawer.gif) @@ -111,8 +148,6 @@ Step 4:enjoy coding ![SplitButton](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/SplitButton.png) -## History publication - ### FloatingBlock ![FloatingBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FloatingBlock.gif) diff --git a/build/build.cake b/build/build.cake index 7a5769ed..7538862b 100644 --- a/build/build.cake +++ b/build/build.cake @@ -47,16 +47,24 @@ Task("Build") var settingsCore30 = new DotNetCoreBuildSettings { Framework = "netcoreapp3.0", - Configuration = "Release", + Configuration = "Release-Core30", OutputDirectory = "lib/netcoreapp3.0" }; + var settingsCore31 = new DotNetCoreBuildSettings + { + Framework = "netcoreapp3.1", + Configuration = "Release-Core31", + OutputDirectory = "lib/netcoreapp3.1" + }; + MSBuild("../src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj", settingsNet40); MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet45); MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet462); MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet47); MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet48); - DotNetCoreBuild("../src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj", settingsCore30); + DotNetCoreBuild("../src/Core_GE30/HandyControl_Core_GE30/HandyControl_Core_GE30.csproj", settingsCore30); + DotNetCoreBuild("../src/Core_GE30/HandyControl_Core_GE30/HandyControl_Core_GE30.csproj", settingsCore31); }); RunTarget(target); \ No newline at end of file diff --git a/build/build.nuspec b/build/build.nuspec index d40e941a..f48902dc 100644 --- a/build/build.nuspec +++ b/build/build.nuspec @@ -2,7 +2,7 @@ HandyControl - 2.3.0 + 2.4.0 HandyOrg HandyOrg HandyOrg @@ -11,7 +11,7 @@ https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/icon.png Contains some commonly used simple WPF controls Changes are detailed at https://github.com/HandyOrg/HandyControl/releases - Copyright © HandyOrg 2018-2019 + Copyright © HandyOrg 2018-2020 WPF C# Control diff --git a/doc/source/handycontrol/attach/panelElement/index.md b/doc/source/handycontrol/attach/panelElement/index.md index ca12ad62..9267ff42 100644 --- a/doc/source/handycontrol/attach/panelElement/index.md +++ b/doc/source/handycontrol/attach/panelElement/index.md @@ -1,5 +1,19 @@ --- -title: 建设中 +title: PanelElement 面板元素 --- -建设中 \ No newline at end of file +# 属性 + +| 名称 | 用途 | +|-|-| +| FluidMoveBehavior | 设置面板的流体移动方式 | + +# 使用案例 + +## FluidMoveBehavior 设置面板的流体移动方式 + +```xml + +``` + +当向面板容器中添加或移除元素时,就可以看到流体移动的动画效果。 \ No newline at end of file diff --git a/doc/source/handycontrol/attach/rectangleAttach/index.md b/doc/source/handycontrol/attach/rectangleAttach/index.md new file mode 100644 index 00000000..4999a04b --- /dev/null +++ b/doc/source/handycontrol/attach/rectangleAttach/index.md @@ -0,0 +1,19 @@ +--- +title: RectangleAttach Rectangle专用 +--- + +# 属性 + +| 名称 | 用途 | +|-|-| +| CornerRadius | 设置Rectangle圆角值 | + +# 使用案例 + +## CornerRadius 设置Rectangle圆角值 + +```xml + +``` + +![RectangleAttach.CornerRadius](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/RectangleAttach.CornerRadius.png) \ No newline at end of file diff --git a/doc/source/handycontrol/attach/textBlockAttach/index.md b/doc/source/handycontrol/attach/textBlockAttach/index.md new file mode 100644 index 00000000..bf355d3f --- /dev/null +++ b/doc/source/handycontrol/attach/textBlockAttach/index.md @@ -0,0 +1,21 @@ +--- +title: TextBlockAttach 文本块专用 +--- + +# 属性 + +| 名称 | 用途 | +|-|-| +| AutoTooltip | 设置是否自动显示工具提示 | + +# 使用案例 + +## AutoTooltip 设置是否自动显示工具提示 + +```xml + + + +``` + +![TextBlockAttach.AutoTooltip](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TextBlockAttach.AutoTooltip.png) \ No newline at end of file diff --git a/doc/source/handycontrol/attach/tipElement/index.md b/doc/source/handycontrol/attach/tipElement/index.md index ca12ad62..6b91f48d 100644 --- a/doc/source/handycontrol/attach/tipElement/index.md +++ b/doc/source/handycontrol/attach/tipElement/index.md @@ -1,5 +1,42 @@ --- -title: 建设中 +title: TipElement 提示元素 --- -建设中 \ No newline at end of file +# 属性 + +| 名称 | 用途 | +| ---------- | -------- | +| Placement | 提示元素显示位置 | +| Visibility | 是否可见 | + + +# 使用案例 + +## Placement 提示元素显示位置 + +该属性,用于设定提示元素显示位置,目前支持BottomRight和TopLeft(默认值) + +``` + + +``` + +效果 + +![TipElement.Default](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TipElement.Default.png) + +![TipElement.TopLeft](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TipElement.TopLeft.png) + diff --git a/doc/source/handycontrol/basic_xaml/converters/index.md b/doc/source/handycontrol/basic_xaml/converters/index.md index 33f62bde..6d256584 100644 --- a/doc/source/handycontrol/basic_xaml/converters/index.md +++ b/doc/source/handycontrol/basic_xaml/converters/index.md @@ -50,6 +50,14 @@ title: 转换器 该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[0/1],[0/1],[0/1],[0/1]`,4个以逗号分隔的值分别对应`CornerRadius`的`Left`、`Top`,`Right`,`Bottom`属性,当值为1则返回对应属性的值,否则返回0。 +# Double2GridLengthConverter + +该转换器会将`double`值转换为`GridLength`。 + +# DoubleMinConverter(内部使用) + +可以向该转换器提供一个字符串作为最小值(如果不提供,则最小值默认为0),当传入的值小于最小值时,返回最小值,否则返回传入的值。 + # Int2StrConverter 该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[字符串0];[字符串1];...[字符串n]`,转换器会将一个整型的值作为索引,来获取指定位置的字符串并返回。 diff --git a/doc/source/handycontrol/basic_xaml/geometries/index.md b/doc/source/handycontrol/basic_xaml/geometries/index.md index 7304c03f..3d01060e 100644 --- a/doc/source/handycontrol/basic_xaml/geometries/index.md +++ b/doc/source/handycontrol/basic_xaml/geometries/index.md @@ -16,6 +16,7 @@ HandyControl中自带了一些几何形状定义,但要应用于生产中显 | LeftGeometry | 左 | | RightGeometry | 右 | | RotateLeftGeometry | 向左旋转 | +| RotateRightGeometry | 向左旋转 | | EnlargeGeometry | 放大 | | ReduceGeometry | 缩小 | | DownloadGeometry | 下载 | @@ -28,6 +29,12 @@ HandyControl中自带了一些几何形状定义,但要应用于生产中显 | WindowMinGeometry | 窗口最小化 | | WindowRestoreGeometry | 窗口还原 | | WindowMaxGeometry | 窗口最大化 | +| CheckedGeometry | 选中 | +| PageModeGeometry | 单页模式 | +| TwoPageModeGeometry | 双页模式 | +| ScrollModeGeometry | 滚动模式 | +| EyeOpenGeometry | 睁眼 | +| EyeCloseGeometry | 闭眼 | | AudioGeometry | 声音 | | BubbleTailGeometry | 气泡的尾巴 | | StarGeometry | 爱心 | diff --git a/doc/source/handycontrol/basic_xaml/sizes/index.md b/doc/source/handycontrol/basic_xaml/sizes/index.md index e8b38ee2..2fbb6e0f 100644 --- a/doc/source/handycontrol/basic_xaml/sizes/index.md +++ b/doc/source/handycontrol/basic_xaml/sizes/index.md @@ -5,7 +5,7 @@ title: 尺寸 | 名称 | 类型 | 值 | 描述 | |-|-| | DefaultControlHeight | System.Double | 30 | 默认控件高度 | -| DefaultControlPadding | System.Windows.Thickness | 12,6 | 默认控件内边距 | +| DefaultControlPadding | System.Windows.Thickness | 10,6 | 默认控件内边距 | | DefaultInputPadding | System.Windows.Thickness | 8,6 |默认输入控件内边距 | | DefaultCornerRadius | System.Windows.CornerRadius | 4 | 默认圆角 | diff --git a/doc/source/handycontrol/extend_controls/buttonGroup/index.md b/doc/source/handycontrol/extend_controls/buttonGroup/index.md new file mode 100644 index 00000000..32d31e77 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/buttonGroup/index.md @@ -0,0 +1,77 @@ +--- +title: ButtonGroup 按钮组 +--- + +# RadioGroupItemBaseStyle + +`ButtonGroup`控件中的子集`RadioButton`样式基类,不建议直接使用,常作为`ButtonGroup`中`Item`样式基类,同时与`ButtonGroup`控件配套使用 + +案例: + +```xml + + + + + + + + + + + + + +``` + +效果: + +![RadioButton.RadioButtonItemDefaultStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/RadioButton.RadioButtonItemDefaultStyle.png) + +# RadioGroup关联样式 + +| 样式Key | 用途 | 基类样式 | +| ----------------------------- | ------------------------------------ | ----------------------- | +| RadioGroupItemDefault | RadioGroupItem默认样式 | RadioGroupItemBaseStyle | +| RadioGroupItemHorizontalFirst | RadioGroupItem水平头样式(从左至右) | RadioGroupItemBaseStyle | +| RadioGroupItemHorizontalLast | RadioGroupItem水平尾样式(从左至右) | RadioGroupItemBaseStyle | +| RadioGroupItemSingle | RadioGroupItem单项样式 | RadioGroupItemBaseStyle | +| RadioGroupItemVerticalFirst | RadioGroupItem垂直头样式(从上至下) | RadioGroupItemBaseStyle | +| RadioGroupItemVerticalLast | RadioGroupItem垂直尾样式(从上至下) | RadioGroupItemBaseStyle | + +案例: + +单个`RadioButton`样式: + +```xml + +``` + +效果: + +![RadioButton.RadioButtonItemSingleStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/RadioButton.RadioButtonItemSingleStyle.png) + +多个`RadioButton`垂直样式: + +```xml + + + + + + + + + + + + + + +``` + +效果: + +![RadioButton.RadioButtonItemVerticalStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/RadioButton.RadioButtonItemVerticalStyle.png) \ No newline at end of file diff --git a/doc/source/handycontrol/extend_controls/calendarWithClock/index.md b/doc/source/handycontrol/extend_controls/calendarWithClock/index.md index ca12ad62..1705ddf9 100644 --- a/doc/source/handycontrol/extend_controls/calendarWithClock/index.md +++ b/doc/source/handycontrol/extend_controls/calendarWithClock/index.md @@ -1,5 +1,66 @@ --- -title: 建设中 +title: CalendarWithClock --- -建设中 \ No newline at end of file + +CalendarWithClock 控件由日历和时钟组成,允许用户通过鼠标选择日期和时间。 + +``` CS +[TemplatePart(Name = ElementButtonConfirm, Type = typeof(Button))] +[TemplatePart(Name = ElementClockPresenter, Type = typeof(ContentPresenter))] +[TemplatePart(Name = ElementCalendarPresenter, Type = typeof(ContentPresenter))] +public class CalendarWithClock : Control +``` + +# 创建日期选取器 + +``` XML + +``` + +``` CS +var dateTimePicker = new CalendarWithClock(); +``` + +生成的CalendarWithClock如下图所示: + +![DateTimePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/CalendarWithClock_1.png) + + + +# 选择日期和时间 + +通过鼠标分别在日历和时钟上选择日期和时间,然后点击 **确定** 按钮即可更新CalendarWithClock控件的日期和时间。 + + +也可以在XAML钟或代码中这样设置日期。 + +``` XML + +``` + +``` CS +calendarWithClock.SelectedDateTime = DateTime.Now; +``` + + + +# 属性 + +| 属性 | 描述 | +| ---------------- | ------------------ | +| SelectedDateTime | 获取或设置当前选中的日期和时间 | +| DateTimeFormat | 获取或设置用于显示选定日期和时间的格式 | +| DisplayDateTime | 获取或设置要显示的日期 | +| ShowConfirmButton | 获取或设置一个值,该值指示是是否显示 **确定** 按钮 | +| VerifyFunc | 获取或设置数据验证委托 | +| IsError | 获取或设置数据是否错误 | +| ErrorStr | 获取或设置错误提示 | +| TextType | 获取或设置文本类型 | +| ShowClearButton | 获取或设置是否显示清除按钮 | + +# 方法 + +| 方法 | 描述 | +| ---------------- | ------------------ | +| VerifyData() | 验证数据 | \ No newline at end of file diff --git a/doc/source/handycontrol/extend_controls/card/index.md b/doc/source/handycontrol/extend_controls/card/index.md new file mode 100644 index 00000000..877d2fd6 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/card/index.md @@ -0,0 +1,3 @@ +--- +title: Card +--- diff --git a/doc/source/handycontrol/extend_controls/datePicker/index.md b/doc/source/handycontrol/extend_controls/datePicker/index.md index ca12ad62..f61a8282 100644 --- a/doc/source/handycontrol/extend_controls/datePicker/index.md +++ b/doc/source/handycontrol/extend_controls/datePicker/index.md @@ -1,5 +1,74 @@ --- -title: 建设中 +title: DatePicker --- -建设中 \ No newline at end of file +DatePicker 控件允许用户通过在文本框中键入日期或使用下拉的日历控件来选择日期。 + +``` CS +[TemplatePart(Name = ElementTextBox, Type = typeof(DatePickerTextBox))] +public class DatePicker : System.Windows.Controls.DatePicker, IDataInput +``` + +# 创建DatePicker + +``` XML + +``` + +``` CS +var datePicker = new DatePicker(); +``` + +生成的DatePicker如下图所示: + +![DatePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/DatePicker_1.png) + + + +# 选择日期 + +可以通过文本框输入日期,或者点击文本框右边的按钮打开下拉的日历控件选择日期。 + +![DatePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/DatePicker_2.png) + +也可以在XAML钟或代码中这样设置日期。 + +``` XML + +``` + +``` CS +datePicker.SelectedDate = DateTime.Now; +``` + +# 设置标题和占位符文本 + +你可以将 Header(标题)和 Placeholder(占位符)添加到DatePicker,以向用户指示其用途。 + +``` XML + +``` + + + + +# 属性 + +| 属性 | 描述 | +| ---------------- | ------------------ | +| SelectedDate | 获取或设置当前选中的日期 | +| VerifyFunc | 获取或设置数据验证委托 | +| IsError | 获取或设置数据是否错误 | +| ErrorStr | 获取或设置错误提示 | +| TextType | 获取或设置文本类型 | +| ShowClearButton | 获取或设置是否显示清除按钮 | + +# 方法 + +| 方法 | 描述 | +| ---------------- | ------------------ | +| VerifyData() | 验证数据 | + diff --git a/doc/source/handycontrol/extend_controls/dateTimePicker/index.md b/doc/source/handycontrol/extend_controls/dateTimePicker/index.md index ca12ad62..8dbbe027 100644 --- a/doc/source/handycontrol/extend_controls/dateTimePicker/index.md +++ b/doc/source/handycontrol/extend_controls/dateTimePicker/index.md @@ -1,5 +1,82 @@ --- -title: 建设中 +title: DateTimePicker --- -建设中 \ No newline at end of file + +DatePicker 控件允许用户通过在文本框中键入日期和时间,或使用下拉的日历控件来选择日期和时间。 + +``` CS +[TemplatePart(Name = ElementRoot, Type = typeof(Grid))] +[TemplatePart(Name = ElementTextBox, Type = typeof(WatermarkTextBox))] +[TemplatePart(Name = ElementButton, Type = typeof(Button))] +[TemplatePart(Name = ElementPopup, Type = typeof(Popup))] +public class DateTimePicker : Control, IDataInput +``` + +# 创建DateTimePicker + +``` XML + +``` + +``` CS +var dateTimePicker = new DateTimePicker(); +``` + +生成的DateTimePicker如下图所示: + +![DateTimePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/DateTimePicker_1.png) + + + +# 选择日期和时间 + +可以通过文本框输入日期和时间,或者点击文本框右边的按钮打开下拉的日历和时钟控件选择日期和时间。 + +![DateTimePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/DateTimePicker_2.png) + +也可以在XAML中或代码中这样设置日期。 + +``` XML + +``` + +``` CS +dateTimePicker.SelectedDateTime = DateTime.Now; +``` + +# 设置标题和占位符文本 + +你可以将 Header(标题)和 Placeholder(占位符)添加到DatePicker,以向用户指示其用途。要使用这两个属性,首先需要应用 **DateTimePickerExtend** 或 **DateTimePickerPlus** 样式。 + +``` XML + +``` + + + + +# 属性 + +| 属性 | 描述 | +| ---------------- | ------------------ | +| SelectedDateTime | 获取或设置当前选中的日期和时间 | +| DateTimeFormat | 获取或设置用于显示选定日期和时间的格式 | +| CalendarStyle | 获取或设置在呈现日历时使用的样式 | +| DisplayDateTime | 获取或设置要显示的日期 | +| IsDropDownOpen | 获取或设置一个值,该值指示是打开还是关闭下拉 Calendar | +| Text | 获取由 **DateTimePicker** 显示的文本,或设置选定日期和时间 | +| VerifyFunc | 获取或设置数据验证委托 | +| IsError | 获取或设置数据是否错误 | +| ErrorStr | 获取或设置错误提示 | +| TextType | 获取或设置文本类型 | +| ShowClearButton | 获取或设置是否显示清除按钮 | + +# 方法 + +| 方法 | 描述 | +| ---------------- | ------------------ | +| VerifyData() | 验证数据 | \ No newline at end of file diff --git a/doc/source/handycontrol/extend_controls/divider/index.md b/doc/source/handycontrol/extend_controls/divider/index.md new file mode 100644 index 00000000..c0af413b --- /dev/null +++ b/doc/source/handycontrol/extend_controls/divider/index.md @@ -0,0 +1,3 @@ +--- +title: Divider +--- diff --git a/doc/source/handycontrol/extend_controls/drawer/index.md b/doc/source/handycontrol/extend_controls/drawer/index.md new file mode 100644 index 00000000..03c8a6ac --- /dev/null +++ b/doc/source/handycontrol/extend_controls/drawer/index.md @@ -0,0 +1,3 @@ +--- +title: Drawer +--- diff --git a/doc/source/handycontrol/extend_controls/floatingBlock/index.md b/doc/source/handycontrol/extend_controls/floatingBlock/index.md new file mode 100644 index 00000000..7eb12950 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/floatingBlock/index.md @@ -0,0 +1,3 @@ +--- +title: FloatingBlock +--- diff --git a/doc/source/handycontrol/extend_controls/glowWindow/index.md b/doc/source/handycontrol/extend_controls/glowWindow/index.md new file mode 100644 index 00000000..bf0d4873 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/glowWindow/index.md @@ -0,0 +1,3 @@ +--- +title: GlowWindow +--- diff --git a/doc/source/handycontrol/extend_controls/grid/index.md b/doc/source/handycontrol/extend_controls/grid/index.md new file mode 100644 index 00000000..d52f1876 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/grid/index.md @@ -0,0 +1,3 @@ +--- +title: Grid +--- diff --git a/doc/source/handycontrol/extend_controls/honeycombPanel/index.md b/doc/source/handycontrol/extend_controls/honeycombPanel/index.md new file mode 100644 index 00000000..9189a4e7 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/honeycombPanel/index.md @@ -0,0 +1,3 @@ +--- +title: HoneycombPanel +--- diff --git a/doc/source/handycontrol/extend_controls/imageBlock/index.md b/doc/source/handycontrol/extend_controls/imageBlock/index.md new file mode 100644 index 00000000..004fee45 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/imageBlock/index.md @@ -0,0 +1,3 @@ +--- +title: ImageBlock +--- diff --git a/doc/source/handycontrol/extend_controls/magnifier/index.md b/doc/source/handycontrol/extend_controls/magnifier/index.md new file mode 100644 index 00000000..e9cd70d1 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/magnifier/index.md @@ -0,0 +1,3 @@ +--- +title: Magnifier +--- diff --git a/doc/source/handycontrol/extend_controls/notification/index.md b/doc/source/handycontrol/extend_controls/notification/index.md new file mode 100644 index 00000000..92b4119e --- /dev/null +++ b/doc/source/handycontrol/extend_controls/notification/index.md @@ -0,0 +1,3 @@ +--- +title: Notification +--- diff --git a/doc/source/handycontrol/extend_controls/numericUpDown/index.md b/doc/source/handycontrol/extend_controls/numericUpDown/index.md index ca12ad62..ad0773ae 100644 --- a/doc/source/handycontrol/extend_controls/numericUpDown/index.md +++ b/doc/source/handycontrol/extend_controls/numericUpDown/index.md @@ -1,5 +1,105 @@ --- -title: 建设中 +title: NumericUpDown 数值选择控件 --- -建设中 \ No newline at end of file +NumericUpDown 控件看起来像一对用户可以单击来调整值的箭头按钮和TextBox的组合,该控件显示并设置数值(Value)。 用户可以通过单击向上和向下箭头,或通过在控件的TextBox部分中键入一个数字来改变Value。 + +``` CS +[TemplatePart(Name = ElementTextBox, Type = typeof(DatePickerTextBox))] +public class DatePicker : System.Windows.Controls.DatePicker, IDataInput +``` + +# 创建NumericUpDown并设置Value + +``` XML + +``` + +``` CS +var numericUpDown = new NumericUpDown(); +numericUpDown.Value = 100; +``` + +生成的NumericUpDown如下图所示: + +![NumericUpDown](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/NumericUpDown_1.png) + + +# 设置DecimalPlaces + +如果需要改变Value显示的小数位数,可以改变DecimalPlaces。DecimalPlaces是一个 **int?** 类型,当它为null时不限制显示的小数位数,否则显示的小数位数为DecimalPlaces的Value。 + +``` XML + +``` + +``` CS +numericUpDown.Value = 10.12345; +numericUpDown.DecimalPlaces = 2; +``` + +![NumericUpDown](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/NumericUpDown_2.png) + +# 设置Increment + +可以通设置Increment改变单击一下按钮时增加或减少的数量。 + +``` XML + +``` + +``` CS +numericUpDown.Increment = 10; +``` + +# 设置上限和下限 + +可以通设置Maximum和Minimum限制Value的上限和下限。 + +``` XML + +``` + +``` CS +numericUpDown.Minimum = 10; +numericUpDown.Maximum = 1000; +``` + +# 设置标题和占位符文本 + +你可以将 Header(标题)和 Placeholder(占位符)添加到NumericUpDown,以向用户指示其用途。要使用这两个附加属性,需要先应用 **NumericUpDownPlus** 样式。 + +``` XML + +``` + +![NumericUpDown](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/NumericUpDown_3.png) + +# 属性 + +| 属性 | 描述 | +| ---------------- | ------------------ | +| Value | 获取或设置当前值 | +| Maximum | 获取或设置最大允许值 | +| Minimum | 获取或设置最小允许值 | +| Increment | 获取或设置单击向上或向下按钮时,数字显示框(也称作 up-down 控件)递增或递减的值。 | +| DecimalPlaces |获取或设置NumericUpDown中要显示的十进制位数。 此属性不会影响 Value 属性。 | +| VerifyFunc | 获取或设置数据验证委托 | +| IsError | 获取或设置数据是否错误 | +| ErrorStr | 获取或设置错误提示 | +| TextType | 获取或设置文本类型 | +| ShowClearButton | 获取或设置是否显示清除按钮 | + +# 方法 + +| 方法 | 描述 | +| ---------------- | ------------------ | +| VerifyData() | 验证数据 | + +# 事件 + +| 事件 | 描述 | +| ---------------- | ------------------ | +| ValueChanged | 在以某种方式更改 Value 属性后发生。 | diff --git a/doc/source/handycontrol/extend_controls/pinBox/index.md b/doc/source/handycontrol/extend_controls/pinBox/index.md new file mode 100644 index 00000000..2f0ef4cf --- /dev/null +++ b/doc/source/handycontrol/extend_controls/pinBox/index.md @@ -0,0 +1,3 @@ +--- +title: PinBox +--- diff --git a/doc/source/handycontrol/extend_controls/popTip/index.md b/doc/source/handycontrol/extend_controls/popTip/index.md new file mode 100644 index 00000000..e28dfc77 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/popTip/index.md @@ -0,0 +1,3 @@ +--- +title: PopTip +--- diff --git a/doc/source/handycontrol/extend_controls/rangeSlider/index.md b/doc/source/handycontrol/extend_controls/rangeSlider/index.md new file mode 100644 index 00000000..d8671ff6 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/rangeSlider/index.md @@ -0,0 +1,3 @@ +--- +title: RangeSlider +--- diff --git a/doc/source/handycontrol/extend_controls/relativePanel/index.md b/doc/source/handycontrol/extend_controls/relativePanel/index.md new file mode 100644 index 00000000..81349147 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/relativePanel/index.md @@ -0,0 +1,3 @@ +--- +title: RelativePanel +--- diff --git a/doc/source/handycontrol/extend_controls/runningBlock/index.md b/doc/source/handycontrol/extend_controls/runningBlock/index.md new file mode 100644 index 00000000..474bc528 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/runningBlock/index.md @@ -0,0 +1,3 @@ +--- +title: RunningBlock +--- diff --git a/doc/source/handycontrol/extend_controls/sideMenu/index.md b/doc/source/handycontrol/extend_controls/sideMenu/index.md new file mode 100644 index 00000000..c7cc2051 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/sideMenu/index.md @@ -0,0 +1,3 @@ +--- +title: SideMenu +--- diff --git a/doc/source/handycontrol/extend_controls/splitButton/index.md b/doc/source/handycontrol/extend_controls/splitButton/index.md new file mode 100644 index 00000000..532fd314 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/splitButton/index.md @@ -0,0 +1,3 @@ +--- +title: SplitButton +--- diff --git a/doc/source/handycontrol/extend_controls/sprite/index.md b/doc/source/handycontrol/extend_controls/sprite/index.md new file mode 100644 index 00000000..59360979 --- /dev/null +++ b/doc/source/handycontrol/extend_controls/sprite/index.md @@ -0,0 +1,3 @@ +--- +title: Sprite +--- diff --git a/doc/source/handycontrol/extend_controls/timePicker/index.md b/doc/source/handycontrol/extend_controls/timePicker/index.md index ca12ad62..5c65e872 100644 --- a/doc/source/handycontrol/extend_controls/timePicker/index.md +++ b/doc/source/handycontrol/extend_controls/timePicker/index.md @@ -1,5 +1,95 @@ --- -title: 建设中 +title: TimePicker --- -建设中 \ No newline at end of file +TimePicker 控件允许用户通过在文本框中键入时间或使用下拉的日历控件来选择时间。 + +``` CS +[TemplatePart(Name = ElementRoot, Type = typeof(Grid))] +[TemplatePart(Name = ElementTextBox, Type = typeof(WatermarkTextBox))] +[TemplatePart(Name = ElementButton, Type = typeof(Button))] +[TemplatePart(Name = ElementPopup, Type = typeof(Popup))] +public class TimePicker : Control, IDataInput +``` + +# 创建TimePicker + +``` XML + +``` + +``` CS +var timePicker = new TimePicker(); +``` + +生成的TimePicker如下图所示: + +![TimePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/TimePicker_1.png) + + + +# 选择时间 + +可以通过文本框输入时间,或者点击文本框右边的按钮打开下拉的时钟控件选择时间。 + +![TimePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/TimePicker_2.png) + +也可以在XAML钟或代码中这样设置日期。 + +``` XML + +``` + +``` CS +timePicker.SelectedTime = DateTime.Now; +``` + +# 更改时钟样式 + +通过更改Clock属性,TimePicker可以更改时钟的样式。 + +``` XML + + + + + +``` + +![TimePicker](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/TimePicker_3.png) + +# 设置标题和占位符文本 + +你可以将 Header(标题)和 Placeholder(占位符)添加到DatePicker,以向用户指示其用途。要使用这两个属性,首先需要应用 **TimePickerExtend** 或 **TimePickerPlus** 样式。 + +``` XML + +``` + + + + +# 属性 + +| 属性 | 描述 | +| ---------------- | ------------------ | +| SelectedTime | 获取或设置当前选中的时间 | +| Clock | 获取或设置下拉时钟 | +| TimeFormat | 获取或设置用于显示选定的时间的格式 | +| DisplayTime | 获取或设置要显示的时间 | +| IsDropDownOpen | 获取或设置一个值,该值指示是打开还是关闭下拉时钟 | +| Text | 获取由 **TimePicker** 显示的文本,或设置选定的时间 | +| VerifyFunc | 获取或设置数据验证委托 | +| IsError | 获取或设置数据是否错误 | +| ErrorStr | 获取或设置错误提示 | +| TextType | 获取或设置文本类型 | +| ShowClearButton | 获取或设置是否显示清除按钮 | + +# 方法 + +| 方法 | 描述 | +| ---------------- | ------------------ | +| VerifyData() | 验证数据 | + diff --git a/doc/source/handycontrol/index.md b/doc/source/handycontrol/index.md index 8c17cc52..a4da7377 100644 --- a/doc/source/handycontrol/index.md +++ b/doc/source/handycontrol/index.md @@ -2,7 +2,7 @@ title: 欢迎使用HandyControl --- -HandyControl是一套WPF控件库,它几乎重写了所有原生样式,同时包含60余款自定义控件(正逐步增加)。 +HandyControl是一套WPF控件库,它几乎重写了所有原生样式,同时包含70余款自定义控件(正逐步增加)。 # 要求 diff --git a/doc/source/handycontrol/langs/index.md b/doc/source/handycontrol/langs/index.md index e33f0268..b3442cff 100644 --- a/doc/source/handycontrol/langs/index.md +++ b/doc/source/handycontrol/langs/index.md @@ -21,9 +21,15 @@ title: 国际化 # 扩展 -控件库自带的语言包包括简体中文(zh-cn)、英文(en)、波斯语(fa)、法语(fr),默认为简体中文(zh-cn): +控件库自带的语言包包括: -![Langs](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/langs/Langs.png) +* 简体中文(zh-cn) +* 英文(en) +* 波斯语(fa) +* 法语(fr) +* 韩文 (ko-kr) + +默认为简体中文(zh-cn)。 如果需要可自行扩展,这里推荐使用开源插件:[ResXManager](https://marketplace.visualstudio.com/items?itemName=TomEnglert.ResXManager),来维护所有的语言包。 diff --git a/doc/source/handycontrol/native_controls/border/index.md b/doc/source/handycontrol/native_controls/border/index.md index 87ddb03a..e3551636 100644 --- a/doc/source/handycontrol/native_controls/border/index.md +++ b/doc/source/handycontrol/native_controls/border/index.md @@ -12,32 +12,32 @@ title: Border 边框 ``` xml - + - + - + - + - + - + @@ -45,6 +45,8 @@ title: Border 边框 ``` +提示:新版本中使用的`BorderRegion`,有别于老版本使用样式`BorderRegionStyle`,由直角变更为圆角 + # BorderVerticallySplitter 此样式使用1单位宽度的Border来分割横向排列的控件。 diff --git a/doc/source/handycontrol/native_controls/flowDocument/index.md b/doc/source/handycontrol/native_controls/flowDocument/index.md new file mode 100644 index 00000000..24ea90d6 --- /dev/null +++ b/doc/source/handycontrol/native_controls/flowDocument/index.md @@ -0,0 +1,117 @@ +--- +title: FlowDocument 流文档 +--- + +# FlowDocumentScrollViewerBaseStyle + +流文档滚动视图默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +案例: + +``` xml + + +
+ + Neptune (planet), major planet in the solar system, eighth planet + from the Sun and fourth largest in diameter. Neptune maintains an almost constant + distance, about 4,490 million km (about 2,790 million mi), from the Sun. Neptune + revolves outside the orbit of Uranus and for most of its orbit moves inside the + elliptical path of the outermost planet Pluto (see Solar System). Every 248 years, + Pluto’s elliptical orbit brings the planet inside Neptune’s nearly circular orbit + for about 20 years, temporarily making Neptune the farthest planet from the Sun. + The last time Pluto’s orbit brought it inside Neptune’s orbit was in 1979. In + 1999 Pluto’s orbit carried it back outside Neptune’s orbit. +
+ + Neptune has 72 times Earth's volume... + +
+ + + + + + + + + + Neptune Stats + + + + + Mean Distance from Sun + + + 4,504,000,000 km + + + + + Mean Diameter + + + 49,532 km + + + + + Approximate Mass + + + 1.0247e26 kg + + + + + + Information from the + Encarta + web site. + + + + +
+
+
+ + Astronomers believe Neptune has an inner rocky core that is surrounded by a vast + ocean of water mixed with rocky material. From the inner core, this ocean extends + upward until it meets a gaseous atmosphere of hydrogen, helium, and trace amounts + of methane. Neptune has four rings and 11 known moons. Even though Neptune's volume + is 72 times Earth’s volume, its mass is only 17.15 times Earth’s mass. Because of + its size, scientists classify Neptune—along with Jupiter, Saturn, and Uranus—as + one of the giant or Jovian planets (so-called because they resemble Jupiter). + + +
+ + Neptune has an orbital period of ~20 years... + +
+ Mathematical theories of astronomy led to the discovery of Neptune. To account for + wobbles in the orbit of the planet Uranus, British astronomer John Couch Adams and + French astronomer Urbain Jean Joseph Leverrier independently calculated the existence + and position of a new planet in 1845 and 1846, respectively. They theorized that the + gravitational attraction of this planet for Uranus was causing the wobbles in Uranus’s + orbit. Using information from Leverrier, German astronomer Johann Gottfried Galle first + observed the planet in 1846. +
+
+
+
+``` + +效果: + +![FlowDocumentScrollViewer](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FlowDocumentScrollViewer.png) + +# FlowDocumentPageViewerBaseStyle + +流文档单页视图默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +# FlowDocumentReaderBaseStyle + +流文档查看器默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/frame/index.md b/doc/source/handycontrol/native_controls/frame/index.md new file mode 100644 index 00000000..b78c4faa --- /dev/null +++ b/doc/source/handycontrol/native_controls/frame/index.md @@ -0,0 +1,17 @@ +--- +title: Frame 导航框架 +--- + +# FrameBaseStyle + +导航框架默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +案例: + +``` xml + +``` + +效果: + +![FrameBaseStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/FrameBaseStyle.png) \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/image/index.md b/doc/source/handycontrol/native_controls/image/index.md index ca12ad62..85764b53 100644 --- a/doc/source/handycontrol/native_controls/image/index.md +++ b/doc/source/handycontrol/native_controls/image/index.md @@ -1,5 +1,18 @@ --- -title: 建设中 +title: Image图片 --- -建设中 \ No newline at end of file +在`HandyControl`中,对应原生的`Image`控件,仅仅提供了一个默认的控件样式,并未提供特殊样式,对于个性化定制,需要使用者自行定制。 + +{% note info no-icon %} +用例: +{% code %} + + + + +{% endcode %} + +![image.baseStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/image.baseStyle.png) + +{% endnote %} \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/label/index.md b/doc/source/handycontrol/native_controls/label/index.md index ca12ad62..cbd200ed 100644 --- a/doc/source/handycontrol/native_controls/label/index.md +++ b/doc/source/handycontrol/native_controls/label/index.md @@ -1,5 +1,87 @@ --- -title: 建设中 +title: Lable标签 --- -建设中 \ No newline at end of file +# LabelBaseStyle + +Label标签默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +{% note info no-icon %} +用例: +{% code %} + +{% endcode %} + +![Label.BaseStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/Label.BaseStyle.png) + +{% endnote %} + +# LabelPrimary : LabelBaseStyle + +主样式 + +{% note info no-icon %} +用例: +{% code %} + +{% endcode %} + +![Label.PrimaryStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/Label.PrimaryStyle.png) + +{% endnote %} + +# LabelSuccess : LabelBaseStyle + +成功类型样式 + +{% note info no-icon %} +用例: +{% code %} + +{% endcode %} + +![Label.SuccessStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/Label.SuccessStyle.png) + +{% endnote %} + +# LabelInfo : LabelBaseStyle + +信息类型样式 + +{% note info no-icon %} +用例: +{% code %} + +{% endcode %} + +![Label.InfoStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/Label.InfoStyle.png) + +{% endnote %} + +# LabelWarning : LabelBaseStyle + +警告类型样式 + +{% note info no-icon %} +用例: +{% code %} + +{% endcode %} + +![Label.WarningStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/Label.WarningStyle.png) + +{% endnote %} + +# LabelDanger : LabelBaseStyle + +危险类型样式 + +{% note info no-icon %} +用例: +{% code %} + +{% endcode %} + +![Label.DangerStyle](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/native_controls/Label.DangerStyle.png) + +{% endnote %} \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/listBox/index.md b/doc/source/handycontrol/native_controls/listBox/index.md index ca12ad62..29de370d 100644 --- a/doc/source/handycontrol/native_controls/listBox/index.md +++ b/doc/source/handycontrol/native_controls/listBox/index.md @@ -1,5 +1,147 @@ --- -title: 建设中 +title: ListBox 列表框 --- -建设中 \ No newline at end of file +# ListBoxBaseStyle + + ListBox默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。 + +{% note info no-icon %} +用例: +{% code %} + - - + + - - + + - - + + + + diff --git a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs index c317945b..c3517b70 100644 --- a/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs +++ b/src/Shared/HandyControlDemo_Shared/Service/Data/DataService.cs @@ -185,6 +185,19 @@ namespace HandyControlDemo.Service }; } + internal List GetWebsiteDataList() + { + return new List + { + new AvatarModel + { + DisplayName = "Dotnet9", + AvatarUri = "https://pic.cnblogs.com/avatar/1663243/20191124121029.png", + Link = "https://dotnet9.com/" + } + }; + } + internal ObservableCollection GetCardDataList() { return new ObservableCollection @@ -360,10 +373,12 @@ namespace HandyControlDemo.Service var jsonObj = JsonConvert.DeserializeObject(jsonStr); foreach (var item in jsonObj) { - var title = Properties.Langs.Lang.ResourceManager.GetString((string)item.title); + var titleKey = (string) item.title; + var title = Properties.Langs.Lang.ResourceManager.GetString(titleKey); var list = Convert2DemoItemList(item.demoItemList); infoList.Add(new DemoInfoModel { + Key = titleKey, Title = title, DemoItemList = list }); diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Converter/HatchBrushConverter.cs b/src/Shared/HandyControlDemo_Shared/Tools/Converter/HatchBrushConverter.cs index 878605f7..6581b245 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Converter/HatchBrushConverter.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Converter/HatchBrushConverter.cs @@ -20,7 +20,7 @@ namespace HandyControlDemo.Tools.Converter { if (value is HatchStyle style) { - return _brushGenerator.GetHatchBrush(style, ResourceHelper.GetResource("DarkPrimaryColor"), ResourceHelper.GetResource("BackgroundColor")); + return _brushGenerator.GetHatchBrush(style, ResourceHelper.GetResource(ResourceToken.DarkPrimaryColor), ResourceHelper.GetResource(ResourceToken.BackgroundColor)); } return Brushes.Transparent; } diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs b/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs index e837c305..e2fcc4cc 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Converter/String2BrushConverter.cs @@ -10,7 +10,7 @@ namespace HandyControlDemo.Tools.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return value is string str ? ResourceHelper.GetResource(str) : default(Brush); + return value is string str ? ResourceHelper.GetResource(str) : default; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Helper/ExternDllHelper.cs b/src/Shared/HandyControlDemo_Shared/Tools/Helper/ExternDllHelper.cs deleted file mode 100644 index a5d0e53d..00000000 --- a/src/Shared/HandyControlDemo_Shared/Tools/Helper/ExternDllHelper.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.InteropServices; - -namespace HandyControlDemo.Tools -{ - internal class ExternDllHelper - { - private const string Winmm = "winmm.dll"; - - [DllImport(Winmm, EntryPoint = "mciSendString", CharSet = CharSet.Auto)] - public static extern int MciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); - } -} \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs b/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs index 0f8aeb4b..c8929ae9 100644 --- a/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs +++ b/src/Shared/HandyControlDemo_Shared/Tools/Helper/Win32Helper.cs @@ -7,5 +7,8 @@ namespace HandyControlDemo.Tools { [DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)] public static extern bool SetForegroundWindow(IntPtr hWnd); + + [DllImport("winmm.dll", EntryPoint = "mciSendString", CharSet = CharSet.Auto)] + public static extern int MciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback); } } diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml index 2615146f..c8e06311 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml @@ -16,7 +16,7 @@ - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs index affe29d0..10a70ab1 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml.cs @@ -1,10 +1,27 @@ -namespace HandyControlDemo.UserControl +using System.Windows.Controls; +using HandyControl.Tools; + +namespace HandyControlDemo.UserControl { public partial class ChatBox { + private ScrollViewer _scrollViewer; + public ChatBox() { InitializeComponent(); + + ListBoxChat.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged; + } + + private void ItemContainerGenerator_ItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs e) + { + if (_scrollViewer == null) + { + _scrollViewer = VisualHelper.GetChild(ListBoxChat); + } + + _scrollViewer?.ScrollToBottom(); } } } diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GotoTopDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GotoTopDemoCtl.xaml index 6ccca191..6ab499a8 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GotoTopDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/GotoTopDemoCtl.xaml @@ -5,7 +5,7 @@ Background="{DynamicResource RegionBrush}"> - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotifyIconDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotifyIconDemoCtl.xaml index 173073e2..36c6aeac 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotifyIconDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotifyIconDemoCtl.xaml @@ -3,8 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs" xmlns:hc="https://handyorg.github.io/handycontrol" - xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" - xmlns:command="http://www.galasoft.ch/mvvmlight" xmlns:data="clr-namespace:HandyControlDemo.Data" DataContext="{Binding NotifyIconDemo,Source={StaticResource Locator}}" Background="{DynamicResource RegionBrush}"> @@ -47,14 +45,14 @@ - - - - - - - - + + + + + + + + @@ -68,14 +66,14 @@ - - - - - - - - + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml index 77fb878d..7ac08446 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NumericUpDownDemoCtl.xaml @@ -7,8 +7,9 @@ - + + @@ -18,6 +19,7 @@ + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml index a8ccd7e0..21762990 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/OutlineTextDemoCtl.xaml @@ -11,6 +11,8 @@ + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PaginationDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PaginationDemoCtl.xaml index f4695b25..84474d60 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PaginationDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PaginationDemoCtl.xaml @@ -26,17 +26,17 @@ - + - + - + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml index 32b35dc6..d6781b14 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml @@ -14,7 +14,6 @@ - diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml new file mode 100644 index 00000000..728c99a3 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs new file mode 100644 index 00000000..02c0ca3a --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs @@ -0,0 +1,21 @@ +using System.Windows; +using HandyControl.Controls; + +namespace HandyControlDemo.UserControl +{ + public partial class PinBoxDemoCtl + { + public PinBoxDemoCtl() + { + InitializeComponent(); + } + + private void PinBox_OnCompleted(object sender, RoutedEventArgs e) + { + if (e.OriginalSource is PinBox pinBox) + { + Growl.Info(pinBox.Password); + } + } + } +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml index 8d247656..30891034 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PoptipDemoCtl.xaml @@ -8,14 +8,14 @@ -