diff --git a/doc/source/handycontrol/attach/backgroundSwitchElement/index.md b/doc/source/handycontrol/attach/backgroundSwitchElement/index.md index 2fa310da..c89a785b 100644 --- a/doc/source/handycontrol/attach/backgroundSwitchElement/index.md +++ b/doc/source/handycontrol/attach/backgroundSwitchElement/index.md @@ -3,40 +3,50 @@ title: BackgroundSwitchElement 可切换背景的元素 --- # 准备工作 + 添加`HandyControl`命名空间 -{% code %} + +```xml xmlns:hc="https://handyorg.github.io/handycontrol" -{% endcode %} +``` -## MouseHoverBackground `鼠标悬浮背景色` +# 相关属性 -该附加属性常用于设置控件在鼠标悬浮时的背景色,在控件的样式或者模板中我们添加如下的触发器代码: +| 名称 | 用途 | +|-|-| +| MouseHoverBackground | 设置鼠标悬浮背景色 | +| MouseDownBackground | 设置鼠标按下背景色 | -{% code %} +# 使用案例 + +## MouseHoverBackground 设置鼠标悬浮背景色 + +在样式或模板中我们添加如下的触发器代码: + +```xml - + -{% endcode %} +``` -随后我们就可以使用该属性了: +前台使用方式: -{% code %} -<目标控件 controls:BackgroundSwitchElement.MouseHoverBackground ="Blue"/> -{% endcode %} +```xml +<目标控件 hc:BackgroundSwitchElement.MouseHoverBackground ="Blue"/> +``` -## MouseDownBackground `鼠标按下背景色` +## MouseDownBackground 设置鼠标按下背景色 -该附加属性常用于设置控件在鼠标按下时的背景色,在控件的样式或者模板中我们添加如下的触发器代码: +在样式或模板中我们添加如下的触发器代码: -{% code %} +```xml - + -{% endcode %} +``` -随后我们就可以使用该属性了: +前台使用方式: -{% code %} -<目标控件 controls:BackgroundSwitchElement.MouseDownBackground ="Yellow"/> -{% endcode %} \ No newline at end of file +```xml +<目标控件 hc:BackgroundSwitchElement.MouseDownBackground ="Yellow"/> +``` \ No newline at end of file diff --git a/doc/source/handycontrol/attach/borderElement/index.md b/doc/source/handycontrol/attach/borderElement/index.md index ca12ad62..c20724df 100644 --- a/doc/source/handycontrol/attach/borderElement/index.md +++ b/doc/source/handycontrol/attach/borderElement/index.md @@ -1,5 +1,75 @@ --- -title: 建设中 +title: BorderElement 具有边框的元素 --- -建设中 \ No newline at end of file +# 准备工作 + +添加`HandyControl`命名空间 + +```xml +xmlns:hc="https://handyorg.github.io/handycontrol" +``` + +# 相关属性 + +| 名称 | 用途 | +|-|-| +| CornerRadius | 设置边框圆角值 | +| Circular | 是否呈现为圆形 True为是、False为否 | + +# 使用案例 + +## CornerRadius 设置边框圆角值 + +```xml + + + + +``` + +![CorberRadius_Case_01](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach\borderelment_case_01.png) + +## Circular 是否呈现为圆形 + +借助`BorderElement.Circular`附加属性实现圆形Border +```xml + +``` +![borderElement_Case_02](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach\borderElement_Case_02.png) + +# 温馨提示 + +## 常见控件支持项 + +**所属** 是指该控件为`WPF默认`控件还是为`HandControl自定义`实现的控件 +**适用属性 ** 为当前控件`BorderElement`对应有效的附加属性 + +| 控件类型 | 所属 | 适用属性 | +| -------- | --------------------- | ------------ | +|Button | WPF默认 | CornerRadius | +|DatePicker|WPF默认| CornerRadius| +|ProgressBar| WPF默认|CornerRadus| +|RadioButton|WPF默认|CornerRadus| +|ToggleButton|WPF默认|CornerRadus| +|RepeatButton|WPF默认|CornerRadus| +|ToolBar|WPF默认|CornerRadus| +|**Border**|WPF默认|**Circular**| +|GroupBox|WPF默认(部分Style)|CornerRadus| +|TextBox | WPF默认、HandyControl | CornerRadius | +|PasswordBox| WPF默认、HandyControl|CornerRadus| +|ComboBox| WPF默认、HandyControl|CornerRadus| +|DateTimePicker|HandyControl|CornerRadus| +|GotoTop|HandyControl|CornerRadus| +|Gravatar|HandyControl|CornerRadus| +|NumericUpDown|HandyControl|CornerRadus| +|ProgressButton| HandyControl|CornerRadus| +|RunningBlock|HandyControl|CornerRadus| +|SearchBar|HandyControl|CornerRadus| +|SplitButton|HandyControl|CornerRadus| +|TabItem|HandyControl|CornerRadus| +|Growl|HandyControl|CornerRadus| +|Shield|HandyControl|CornerRadus(暂时无效)| +|Tag|HandyControl|CornerRadus(暂时无效)| + + diff --git a/doc/source/handycontrol/attach/images/Attach.png b/doc/source/handycontrol/attach/images/Attach.png deleted file mode 100644 index efda668e..00000000 Binary files a/doc/source/handycontrol/attach/images/Attach.png and /dev/null differ diff --git a/doc/source/handycontrol/attach/index.md b/doc/source/handycontrol/attach/index.md index c8aa438a..7b459d0e 100644 --- a/doc/source/handycontrol/attach/index.md +++ b/doc/source/handycontrol/attach/index.md @@ -4,6 +4,6 @@ title: 附加属性 附加属性源码在Controls / Attach文件夹中: -![Attach](images/Attach.png) +![Attach](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/Attach.png) 以`Element`结尾的类,可以为所有的控件设置一些共有的属性,以`Attach`结尾的类,只能为一种控件设置相关的属性。 \ No newline at end of file diff --git a/doc/source/handycontrol/basic_xaml/converters/index.md b/doc/source/handycontrol/basic_xaml/converters/index.md index 8b936e70..33f62bde 100644 --- a/doc/source/handycontrol/basic_xaml/converters/index.md +++ b/doc/source/handycontrol/basic_xaml/converters/index.md @@ -22,13 +22,21 @@ title: 转换器 该转换器会将布尔数组转换为`Visibility`,当数组内全部为`true`时,返回`Visible`,否则返回`Collapse`。 +# BorderCircularClipConverter + +该转换器为Border专用,接受一个object数组,该数组长度为3,分别对应Border的长、宽和圆角半径,它会返回一个圆形几何形状作为Clip来剪裁Border。 + # BorderCircularConverter 该转换器为Border专用,接受`Border`的长和宽合成的一个整型数组,返回它们中最小值的一半,作为圆形Border的半径。 # BorderClipConverter -该转换器为Border专用,接受一个object数组,该数组长度为3,分别对应Border的长、宽和圆角半径,它会返回一个圆形几何形状作为Clip来剪裁Border。 +该转换器为Border专用,接受一个object数组,该数组长度为3,分别对应Border的长、宽和圆角半径,它会返回一个圆角矩形作为Clip来剪裁Border。 + +# ColLayoutConverter + +该转换器用于xaml设计时,主要功能是将字符串转换为有效的`ColLayout`值。 # Color2ChannelAConverter(内部使用) @@ -38,6 +46,10 @@ title: 转换器 该转换器会将`SolidColorBrush`转换为16进制字符串形式(带“#”)。 +# CornerRadiusSplitConverter + +该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[0/1],[0/1],[0/1],[0/1]`,4个以逗号分隔的值分别对应`CornerRadius`的`Left`、`Top`,`Right`,`Bottom`属性,当值为1则返回对应属性的值,否则返回0。 + # Int2StrConverter 该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[字符串0];[字符串1];...[字符串n]`,转换器会将一个整型的值作为索引,来获取指定位置的字符串并返回。 @@ -46,6 +58,10 @@ title: 转换器 该转换器会将长整型转换为文件大小的字符串。 +# Number2PercentageConverter + +该转换器接受一个长度为2的数字数组,返回两数的百分比值。 + # Object2BooleanConverter 如果该转换器获取到的值为`null`则返回`false`,否则返回`true`。 @@ -54,6 +70,10 @@ title: 转换器 如果该转换器获取到的值为`null`则返回`Collapsed`,否则返回`Visible`。 +# RectangleCircularConverter + +该转换器为Rectangle专用,接受`Rectangle`的长和宽合成的一个整型数组,返回它们中最小值的一半,作为圆形Rectangle的半径。 + # String2VisibilityConverter 该转换器接受一个字符串,如果该字符串为空或者为null,则返回`Collapse`,否则返回`Visible`。 @@ -62,6 +82,10 @@ title: 转换器 该转换器情况与`String2VisibilityConverter`相反。 +# ThicknessSplitConverter + +该转换器需要提供一个字符串作为参数,该字符串的一般形式为:`[0/1],[0/1],[0/1],[0/1]`,4个以逗号分隔的值分别对应`Thickness`的`Left`、`Top`,`Right`,`Bottom`属性,当值为1则返回对应属性的值,否则返回0。 + # TreeViewItemMarginConverter(内部使用) 该转换器用于为TreeViewItem提供适当的左边距。 diff --git a/doc/source/handycontrol/basic_xaml/images/Basic_Structure.png b/doc/source/handycontrol/basic_xaml/images/Basic_Structure.png deleted file mode 100644 index a6a25bec..00000000 Binary files a/doc/source/handycontrol/basic_xaml/images/Basic_Structure.png and /dev/null differ diff --git a/doc/source/handycontrol/basic_xaml/index.md b/doc/source/handycontrol/basic_xaml/index.md index 273f7885..8d187f3b 100644 --- a/doc/source/handycontrol/basic_xaml/index.md +++ b/doc/source/handycontrol/basic_xaml/index.md @@ -3,7 +3,7 @@ title: 基础xaml定义 --- 基础xaml定义都在Basic文件夹中,其内部结构如下: -![Basic_Structure](images/Basic_Structure.png) +![Basic_Structure](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/basic_xaml/Basic_Structure.png) 对它们的描述如下表所示: diff --git a/doc/source/handycontrol/extend_controls/growl/index.md b/doc/source/handycontrol/extend_controls/growl/index.md index 8a7b8c0e..744b2956 100644 --- a/doc/source/handycontrol/extend_controls/growl/index.md +++ b/doc/source/handycontrol/extend_controls/growl/index.md @@ -6,7 +6,7 @@ title: Growl 信息通知 # 控件效果 -![Growl](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Growl.gif) +![Growl](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Growl.gif) # 准备工作 diff --git a/doc/source/handycontrol/images/Build_Config.png b/doc/source/handycontrol/images/Build_Config.png deleted file mode 100644 index 8568462f..00000000 Binary files a/doc/source/handycontrol/images/Build_Config.png and /dev/null differ diff --git a/doc/source/handycontrol/images/Net_GE45_Structure.png b/doc/source/handycontrol/images/Net_GE45_Structure.png deleted file mode 100644 index 86c385a6..00000000 Binary files a/doc/source/handycontrol/images/Net_GE45_Structure.png and /dev/null differ diff --git a/doc/source/handycontrol/images/Project_Structure.png b/doc/source/handycontrol/images/Project_Structure.png deleted file mode 100644 index e7a9f4ed..00000000 Binary files a/doc/source/handycontrol/images/Project_Structure.png and /dev/null differ diff --git a/doc/source/handycontrol/images/Sub_Folder_Structure.png b/doc/source/handycontrol/images/Sub_Folder_Structure.png deleted file mode 100644 index 29f49557..00000000 Binary files a/doc/source/handycontrol/images/Sub_Folder_Structure.png and /dev/null differ diff --git a/doc/source/handycontrol/index.md b/doc/source/handycontrol/index.md index 407206a8..5c4aec84 100644 --- a/doc/source/handycontrol/index.md +++ b/doc/source/handycontrol/index.md @@ -2,17 +2,11 @@ title: 欢迎使用HandyControl --- -HandyControl是一套WPF控件库,它几乎重写了所有原生样式,同时包含50多款额外的控件(正逐步增加)。 +HandyControl是一套WPF控件库,它几乎重写了所有原生样式,同时包含60余款自定义控件(正逐步增加)。 # 要求 -- 使用要求 -.Net >= 4.0 -OS >= win7 - -- 编译要求 -IDE >= vs2019 -C# >= 7.3 +![dotnet-require](https://img.shields.io/badge/.net-%3E%3D4.0-blue.svg) ![os-require](https://img.shields.io/badge/OS-%3E%3Dwin7-brightgreen) ![IDE-require](https://img.shields.io/badge/IDE-vs2019-blue.svg) ![csharp-require](https://img.shields.io/badge/C%23-8.0-blue.svg) # 下载 @@ -39,7 +33,7 @@ Github上一般每天都有更新,相对而言不适合用于生产。 ## 整体结构 从Github上克隆好源码后,进入src文件夹,该文件夹结构如下: -![Project_Structure](images/Project_Structure.png) +![Project_Structure](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/Project_Structure.png) 这里一共有4个解决方案sln文件。 @@ -48,14 +42,14 @@ Github上一般每天都有更新,相对而言不适合用于生产。 `Shared`文件夹用于存放共享项目的代码 图中五个文件夹内部各包含两个子文件夹,例如在Shared中还包含两个子文件夹: -![Sub_Folder_Structure](images/Sub_Folder_Structure.png) +![Sub_Folder_Structure](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/Sub_Folder_Structure.png) 它们分别存放控件源码和控件示例源码。 ## 源码结构 -我们以HandyControl_Net_GE45.sln为示例进行说明,使用VS2017打开该解决方案: -![Net_GE45_Structure](images/Net_GE45_Structure.png) +我们以HandyControl.sln为示例进行说明,使用VS2019打开该解决方案: +![Net_GE45_Structure](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/Net_GE45_Structure.png) 如果要启动示例,查看控件效果,请将HandyControlDemo_[指定的项目类型]作为启动项。 @@ -82,7 +76,7 @@ Controls中的每个控件一般都能在Themes中找到对应的xaml定义。 # 编译源码 {% note warning %} -编译前请确认你的开发环境是否符合使用要求。 +编译前请确认你的开发环境是否符合要求。 {% endnote %} {% note info %} diff --git a/doc/source/handycontrol/native_controls/border/index.md b/doc/source/handycontrol/native_controls/border/index.md index 63da2560..444d5c9f 100644 --- a/doc/source/handycontrol/native_controls/border/index.md +++ b/doc/source/handycontrol/native_controls/border/index.md @@ -6,7 +6,7 @@ title: Border 边框 此样式用于包裹一个控件区域,配合基础xaml定义中的几个DropShadowEffect资源可制作如下效果: -![Border](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Border.png) +![Border](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Border.png) 以上效果的xaml代码如下: diff --git a/doc/source/handycontrol/native_controls/calendar/index.md b/doc/source/handycontrol/native_controls/calendar/index.md index 6f7f0482..1ffb9210 100644 --- a/doc/source/handycontrol/native_controls/calendar/index.md +++ b/doc/source/handycontrol/native_controls/calendar/index.md @@ -12,5 +12,5 @@ title: Calendar 日历 {% code %} {% endcode %} -![Calendar](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Calendar.jpg) +![Calendar](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Calendar.jpg) {% endnote %} \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/checkBox/index.md b/doc/source/handycontrol/native_controls/checkBox/index.md index 4218e941..1ad33b14 100644 --- a/doc/source/handycontrol/native_controls/checkBox/index.md +++ b/doc/source/handycontrol/native_controls/checkBox/index.md @@ -19,5 +19,5 @@ title: CheckBox 复选框 {% endcode %} -![CheckBox](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/CheckBox.png) +![CheckBox](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/CheckBox.png) {% endnote %} \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/contextMenu/index.md b/doc/source/handycontrol/native_controls/contextMenu/index.md index fdcf837e..0c78954a 100644 --- a/doc/source/handycontrol/native_controls/contextMenu/index.md +++ b/doc/source/handycontrol/native_controls/contextMenu/index.md @@ -18,5 +18,5 @@ title: ContextMenu 上下文菜单 {% endcode %} -![ContextMenu](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/ContextMenu.png) +![ContextMenu](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/ContextMenu.png) {% endnote %} \ No newline at end of file diff --git a/doc/source/handycontrol/native_controls/dataGrid/index.md b/doc/source/handycontrol/native_controls/dataGrid/index.md index 093d0e09..2372b457 100644 --- a/doc/source/handycontrol/native_controls/dataGrid/index.md +++ b/doc/source/handycontrol/native_controls/dataGrid/index.md @@ -41,7 +41,7 @@ title: DataGrid 数据表格 {% endcode %} -![ContextMenu](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/DataGrid.png) +![DataGrid](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/DataGrid.png) {% endnote %} # FAQ diff --git a/doc/source/handycontrol/tnx/index.md b/doc/source/handycontrol/tnx/index.md index 129c2af4..e06e9b33 100644 --- a/doc/source/handycontrol/tnx/index.md +++ b/doc/source/handycontrol/tnx/index.md @@ -4,15 +4,11 @@ title: 鸣谢 # 感谢以下Coder提供代码贡献 -

ghost1372Dingping ZhangM0n7y5guanguanchuangyuyanchao891012noctwolf

- -# 感谢以下User提供使用建议 - -

xianyun666

+

ghost1372Dingping ZhangM0n7y5guanguanchuangyuyanchao891012noctwolfxianyun666

# 感谢以下组织机构提供开源许可 -

JetBrains

+

JetBrains

# 感谢以下捐赠者 diff --git a/doc/themes/next/source/css/_custom/custom.styl b/doc/themes/next/source/css/_custom/custom.styl index 5a664b44..aa011872 100644 --- a/doc/themes/next/source/css/_custom/custom.styl +++ b/doc/themes/next/source/css/_custom/custom.styl @@ -3,4 +3,9 @@ margin: 3px; display: inline; padding: 3px !important; +} + +.post-body h2 { + font-size: 1.45em; + border-bottom: 0px solid #eee; } \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Tools/Converter/ThicknessSplitConverter.cs b/src/Shared/HandyControl_Shared/Tools/Converter/ThicknessSplitConverter.cs index f024dc3a..91cf6004 100644 --- a/src/Shared/HandyControl_Shared/Tools/Converter/ThicknessSplitConverter.cs +++ b/src/Shared/HandyControl_Shared/Tools/Converter/ThicknessSplitConverter.cs @@ -9,17 +9,17 @@ namespace HandyControl.Tools.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (value is Thickness cornerRadius) + if (value is Thickness thickness) { if (parameter is string str) { var arr = str.Split(','); - if (arr.Length != 4) return cornerRadius; + if (arr.Length != 4) return thickness; - return new CornerRadius(arr[0].Equals("1") ? cornerRadius.Left : 0, - arr[1].Equals("1") ? cornerRadius.Top : 0, - arr[1].Equals("1") ? cornerRadius.Right : 0, - arr[1].Equals("1") ? cornerRadius.Bottom : 0); + return new Thickness(arr[0].Equals("1") ? thickness.Left : 0, + arr[1].Equals("1") ? thickness.Top : 0, + arr[1].Equals("1") ? thickness.Right : 0, + arr[1].Equals("1") ? thickness.Bottom : 0); } } return value;