Merge pull request #101 from guanguanchuangyu/master
modified doc of BackgroundSwitchElement
This commit is contained in:
2 files changed
+40
-3
No files matched your search
@@ -1,5 +1,42 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: BackgroundSwitchElement 可切换背景的元素
|
||||
---
|
||||
|
||||
建设中
|
||||
# 准备工作
|
||||
添加`HandyControl`命名空间
|
||||
{% code %}
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
{% endcode %}
|
||||
|
||||
## MouseHoverBackground `鼠标悬浮背景色`
|
||||
|
||||
该附加属性常用于设置控件在鼠标悬浮时的背景色,在控件的样式或者模板中我们添加如下的触发器代码:
|
||||
|
||||
{% code %}
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
{% endcode %}
|
||||
|
||||
随后我们就可以使用该属性了:
|
||||
|
||||
{% code %}
|
||||
<目标控件 controls:BackgroundSwitchElement.MouseHoverBackground ="Blue"/>
|
||||
{% endcode %}
|
||||
|
||||
## MouseDownBackground `鼠标按下背景色`
|
||||
|
||||
该附加属性常用于设置控件在鼠标按下时的背景色,在控件的样式或者模板中我们添加如下的触发器代码:
|
||||
|
||||
{% code %}
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" TargetName="Chrome"
|
||||
Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</Trigger>
|
||||
{% endcode %}
|
||||
|
||||
随后我们就可以使用该属性了:
|
||||
|
||||
{% code %}
|
||||
<目标控件 controls:BackgroundSwitchElement.MouseDownBackground ="Yellow"/>
|
||||
{% endcode %}
|
||||
@@ -4,7 +4,7 @@ title: 鸣谢
|
||||
|
||||
# 感谢以下Coder提供代码贡献
|
||||
|
||||
<p><a style="border:0" href="https://github.com/ghost1372" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/9213496?s=400&v=4" alt="ghost1372"></a><a style="border:0" href="https://github.com/DingpingZhang" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/8541016?s=400&v=4" alt="Dingping Zhang"></a><a style="border:0" href="https://github.com/M0n7y5" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/17201053?s=400&v=4" alt="M0n7y5"></a><a style="border:0" href="https://github.com/guanguanchuangyu" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/25916858?s=400&v=4" alt="guanguanchuangyu"></a><a style="border:0" href="https://github.com/yanchao891012" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/16846702?s=400&v=4" alt="guanguanchuangyu"></a></p>
|
||||
<p><a style="border:0" href="https://github.com/ghost1372" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/9213496?s=400&v=4" alt="ghost1372"></a><a style="border:0" href="https://github.com/DingpingZhang" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/8541016?s=400&v=4" alt="Dingping Zhang"></a><a style="border:0" href="https://github.com/M0n7y5" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/17201053?s=400&v=4" alt="M0n7y5"></a><a style="border:0" href="https://github.com/guanguanchuangyu" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/25916858?s=400&v=4" alt="guanguanchuangyu"></a><a style="border:0" href="https://github.com/yanchao891012" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/16846702?s=400&v=4" alt="yanchao891012"></a><a style="border:0" href="https://github.com/noctwolf" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars3.githubusercontent.com/u/21022467?s=400&v=4" alt="noctwolf"></a></p>
|
||||
|
||||
# 感谢以下User提供使用建议
|
||||
|
||||
|
||||
Reference in new issue
Block a user