Skip to content

Commit db8ce28

Browse files
committed
completed extend-controls docs
1 parent 625aeba commit db8ce28

28 files changed

Lines changed: 555 additions & 25 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: DropDownElement 可下拉内容的元素
3+
---
4+
5+
# 属性
6+
7+
| 名称 | 用途 |
8+
|-|-|
9+
| ConsistentWidth | 下拉内容是否和下拉框宽度一致 |
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: ImageAttach Image专用
3+
---
4+
5+
# 属性
6+
7+
| 名称 | 用途 |
8+
|-|-|
9+
| SourceFailed | 图片加载失败后显示的图片 |

doc/source/handycontrol/attach/infoElement/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ title: InfoElement 信息元素
1818
| ContentHeight | 内容高度 |
1919
| MinContentHeight | 最小内容高度 |
2020
| MaxContentHeight | 最大内容高度 |
21+
| RegexPattern | 正则表达式 |
2122

2223
# 使用案例
2324

@@ -66,4 +67,8 @@ title: InfoElement 信息元素
6667
Style="{StaticResource SearchBarExtend}"/>
6768
```
6869

69-
![InfoElement.ContentHeight](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/InfoElement.ContentHeight.png)
70+
![InfoElement.ContentHeight](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/InfoElement.ContentHeight.png)
71+
72+
## RegexPattern 正则表达式
73+
74+
通过设置该属性,可自定义信息元素内部的验证逻辑实现对指定格式外的内容进行错误提示。

doc/source/handycontrol/attach/tipElement/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: TipElement 提示元素
88
| ---------- | -------- |
99
| Placement | 提示元素显示位置 |
1010
| Visibility | 是否可见 |
11+
| StringFormat | 文本格式 |
1112

1213

1314
# 使用案例

doc/source/handycontrol/attach/titleElement/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: TitleElement 标题元素
1010
| Background | 标题背景色 |
1111
| Foreground | 标题字体色 |
1212
| BorderBrush | 标题边框色 |
13-
| TitleAlignment | 标题对齐方式 |
13+
| TitlePlacement | 标题对齐方式 |
1414
| TitleWidth | 标题宽度 |
1515

1616
# 使用案例
@@ -24,32 +24,32 @@ title: TitleElement 标题元素
2424

2525
![TitleElement.Title](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TitleElement.Title.png)
2626

27-
## TitleAlignment 标题对齐方式
27+
## TitlePlacement 标题对齐方式
2828

2929
```xml
3030
<!--标题居于顶侧-->
3131
<hc:TextBox hc:TitleElement.Title="标题信息"
32-
hc:TitleElement.TitleAlignment="Top"
32+
hc:TitleElement.TitlePlacement="Top"
3333
Margin="10,10"></hc:TextBox>
3434
<!--标题居于左侧-->
3535
<hc:TextBox hc:TitleElement.Title="标题信息"
36-
hc:TitleElement.TitleAlignment="Left"
36+
hc:TitleElement.TitlePlacement="Left"
3737
Margin="10,10"></hc:TextBox>
3838
```
3939

40-
![TitleElement.TitleAlignment](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TitleElement.TitleAlignment.png)
40+
![TitleElement.TitlePlacement](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/attach/TitleElement.TitlePlacement.png)
4141

4242
## TitleWidth 标题宽度
4343

4444
```xml
4545
<!--设定TitleWidth为Auto-->
4646
<hc:TextBox hc:TitleElement.Title="标题信息"
47-
hc:TitleElement.TitleAlignment="Left"
47+
hc:TitleElement.TitlePlacement="Left"
4848
hc:TitleElement.TitleWidth="Auto"
4949
Margin="10,10"></hc:TextBox>
5050
<!--设定TitleWidth为具体数值-->
5151
<hc:TextBox hc:TitleElement.Title="标题信息"
52-
hc:TitleElement.TitleAlignment="Left"
52+
hc:TitleElement.TitlePlacement="Left"
5353
hc:TitleElement.TitleWidth="60"
5454
Margin="10,10"></hc:TextBox>
5555
```

doc/source/handycontrol/attach/visualElement/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ title: VisualElement 可视化元素
77
| 名称 | 用途 |
88
| -------------- | ---------------- |
99
| HighlightBrush | 设置控件高亮颜色 |
10+
| HighlightBackground | 设置控件高亮背景颜色 |
11+
| HighlightBorderBrush | 设置控件高亮边框颜色 |
12+
| HighlightForeground | 设置控件高亮前景颜色 |
1013
| Text | 设置文本内容 |
1114

1215
# 使用案例
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: BlurWindow 背景模糊窗口
3+
---
4+
5+
背景模糊窗口可用于增强UI效果,但是会牺牲部分性能.
6+
7+
```cs
8+
public class BlurWindow : Window
9+
```
10+
11+
{% note warning %}
12+
操作系统支持范围:win10 10240 ~ win10 18362
13+
{% endnote %}
14+
15+
{% note warning %}
16+
重写资源 `BlurGradientValue` 可自定义模糊颜色
17+
{% endnote %}
18+
19+
# 案例
20+
21+
```xml
22+
<system:UInt32 x:Key="BlurGradientValue">0x99FFFFFF</system:UInt32>
23+
```
24+
25+
```xml
26+
<hc:BlurWindow x:Class="HandyControlDemo.Window.BlurWindow"
27+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
28+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
29+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
30+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
31+
xmlns:hc="https://handyorg.github.io/handycontrol"
32+
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
33+
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
34+
mc:Ignorable="d"
35+
Style="{StaticResource WindowBlur}"
36+
WindowStartupLocation="CenterScreen"
37+
Title="{ex:Lang Key={x:Static langs:LangKeys.Title}}"
38+
Height="450"
39+
Width="800"
40+
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
41+
</hc:BlurWindow>
42+
```
43+
44+
![BlurWindow](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/BlurWindow.png)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: CheckComboBox 复选组合框
3+
---
4+
5+
可选选中多个项目的组合框.
6+
7+
```cs
8+
[TemplatePart(Name = ElementPanel, Type = typeof(Panel))]
9+
[TemplatePart(Name = ElementSelectAll, Type = typeof(CheckComboBoxItem))]
10+
public class CheckComboBox : ListBox, IDataInput
11+
```
12+
13+
# 属性
14+
15+
|属性|描述|默认值|备注|
16+
|-|-|-|-|
17+
|VerifyFunc|数据验证委托|||
18+
|IsError|数据是否错误|false||
19+
|ErrorStr|错误提示|||
20+
|TextType|文本类型|||
21+
|ShowClearButton|是否显示清除按钮|false||
22+
|MaxDropDownHeight|下拉内容最大高度|||
23+
|IsDropDownOpen|下拉框是否展开|false||
24+
|TagStyle|选中标记样式|||
25+
|ShowSelectAllButton|是否显示选中所有按钮|false|||
26+
27+
# 附加属性
28+
29+
|属性|描述|默认值|备注|
30+
|-|-|-|-|
31+
|InfoElement.Placeholder|占位符|||
32+
|InfoElement.Necessary|是否必填|false||
33+
|InfoElement.Symbol|必填标记|●||
34+
|InfoElement.ContentHeight|内容高度|30|标题在上时可用|
35+
|InfoElement.MinContentHeight|最小内容高度|30|标题在上时可用|
36+
|TitleElement.Title|标题|||
37+
|TitleElement.TitlePlacement|标题对齐方式|TitlePlacementType.Top||
38+
|TitleElement.TitleWidth|标题宽度|120||
39+
|DropDownElement.ConsistentWidth|下拉内容是否和下拉框宽度一致|false|||
40+
41+
# 方法
42+
43+
|方法|描述|备注|
44+
|-|-|-|
45+
|VerifyData|验证数据|可手动触发验证|
46+
47+
# 样式
48+
49+
|样式|描述|
50+
|-|-|
51+
|CheckComboBoxBaseStyle|默认样式|
52+
|CheckComboBoxExtendBaseStyle|默认扩展样式|
53+
|CheckComboBoxPlusBaseStyle|默认增强样式|
54+
|CheckComboBoxExtend|扩展样式|
55+
|CheckComboBoxPlus|增强样式|
56+
57+
# 案例
58+
59+
```xml
60+
<StackPanel Margin="32" Orientation="Horizontal">
61+
<StackPanel>
62+
<hc:CheckComboBox ShowClearButton="True" MaxWidth="380" ItemsSource="{Binding DataList}" ShowSelectAllButton="True"/>
63+
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxExtend}" Margin="0,16,0,0" IsEnabled="False" ShowSelectAllButton="True"/>
64+
65+
<hc:CheckComboBox ShowClearButton="True" MaxWidth="380" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
66+
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
67+
68+
<hc:CheckComboBox ShowClearButton="True" Width="380" ItemsSource="{Binding DataList}" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
69+
<hc:CheckComboBox Width="380" ItemsSource="{Binding DataList}" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource CheckComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
70+
</StackPanel>
71+
<StackPanel Margin="32,0,0,0">
72+
<hc:CheckComboBox ShowClearButton="True" MaxWidth="380" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxPlus}" ShowSelectAllButton="True"/>
73+
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" Margin="0,16,0,0" IsEnabled="False" Style="{StaticResource CheckComboBoxPlus}"/>
74+
75+
<hc:CheckComboBox MaxWidth="380" ShowClearButton="True" ItemsSource="{Binding DataList}" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
76+
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
77+
78+
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" ShowClearButton="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" ShowSelectAllButton="True"/>
79+
<hc:CheckComboBox MaxWidth="380" ItemsSource="{Binding DataList}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource CheckComboBoxPlus}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
80+
</StackPanel>
81+
</StackPanel>
82+
```
83+
84+
![CheckComboBox](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/CheckComboBox.png)

doc/source/handycontrol/extend_controls/comboBox/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public class ComboBox : System.Windows.Controls.ComboBox, IDataInput
3030
|InfoElement.MinContentHeight|最小内容高度|30|标题在上时可用|
3131
|TitleElement.Title|标题|||
3232
|TitleElement.TitlePlacement|标题对齐方式|TitlePlacementType.Top||
33-
|TitleElement.TitleWidth|标题宽度|120|||
33+
|TitleElement.TitleWidth|标题宽度|120||
34+
|DropDownElement.ConsistentWidth|下拉内容是否和下拉框宽度一致|false|||
3435

3536
# 方法
3637

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: ContextMenuButton 上下文菜单按钮
3+
---
4+
5+
HC提供了两个上下文菜单按钮,分别是 `ContextMenuButton``ContextMenuToggleButton`,它们的使用方式和普通 `Button``ToggleButton` 一致,唯一的区别是提供了 `Menu` 属性,可用于实现点击按钮弹出上下文菜单的效果。

0 commit comments

Comments
 (0)