add doc of attach/borderElement

This commit is contained in:
guanguanchuangyu committed 2019-10-26 17:07:52 +08:00
1 parent 1af8ac90f4
commit c16cca2dcb
4 files changed
+74 -6

No files matched your search

@@ -14,14 +14,14 @@ xmlns:hc="https://handyorg.github.io/handycontrol"
{% code %}
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(hc:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
{% endcode %}
随后我们就可以使用该属性了:
{% code %}
<目标控件 controls:BackgroundSwitchElement.MouseHoverBackground ="Blue"/>
<目标控件 hc:BackgroundSwitchElement.MouseHoverBackground ="Blue"/>
{% endcode %}
## MouseDownBackground `鼠标按下背景色`
@@ -31,12 +31,12 @@ xmlns:hc="https://handyorg.github.io/handycontrol"
{% code %}
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="Chrome"
Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
Value="{Binding Path=(hc:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
{% endcode %}
随后我们就可以使用该属性了:
{% code %}
<目标控件 controls:BackgroundSwitchElement.MouseDownBackground ="Yellow"/>
<目标控件 hc:BackgroundSwitchElement.MouseDownBackground ="Yellow"/>
{% endcode %}
@@ -1,5 +1,73 @@
---
title: 建设中
title: 具有边框的元素
---
# 准备工作
使用该系附加属性的`.xaml`文件中,需要添加`HandyControl`命名空间
{% code %}
xmlns:hc="https://handyorg.github.io/handycontrol"
{% endcode %}
# 相关属性
| 名称 | 用途 |
| ------------ | ---------------------------------- |
| CornerRadius | 设置边框圆角值 |
| Circular | 是否呈现为圆形 True为是、False为否 |
# 使用案例
## CornerRadius
设置边框的圆角值
```xml
<Button Content="[Button]测试CornerRadius" hc:BorderElement.CornerRadius="0"></Button>
<hc:TextBox Text="[hc:TextBox]测试CornerRadius" hc:BorderElement.CornerRadius="15"></hc:TextBox>
<TextBox Text="[TextBox]测试CornerRadius" hc:BorderElement.CornerRadius="0"></TextBox>
<Button Content="[Button]测试CornerRadius" hc:BorderElement.CornerRadius="0,0,4,4"></Button>
```
**效果图如下:**
![CorberRadius_Case_01](..\images\borderelment_case_01.png)
## Circular
借助`BorderElement.Circular`附加属性实现圆形Border
```xml
<Border Style="{StaticResource BorderCircular}" Background="OrangeRed" Width="100" Height="100"/>
```
**效果如下:**
![borderElement_Case_02](..\images\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(暂时无效)|
建设中
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB