add doc
This commit is contained in:
1 parent
28c464a8e2
commit
0eb9bed399
3 files changed
+67
-12
No files matched your search
@@ -4,11 +4,11 @@ title: Growl 信息通知
|
|||||||
|
|
||||||
当需要在窗口的右侧区域,以从上到下排列通知信息时可以使用本控件。
|
当需要在窗口的右侧区域,以从上到下排列通知信息时可以使用本控件。
|
||||||
|
|
||||||
## 控件效果
|
# 控件效果
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 准备工作
|
# 准备工作
|
||||||
|
|
||||||
在指定的窗口右侧区域添加`StackPanel`容器
|
在指定的窗口右侧区域添加`StackPanel`容器
|
||||||
``` xml
|
``` xml
|
||||||
@@ -18,7 +18,7 @@ title: Growl 信息通知
|
|||||||
```
|
```
|
||||||
为了方便滚动,一般会在外层包一个`ScrollViewer`,同时为了美观,我们设置`ScrollViewer`的`VerticalScrollBarVisibility="Hidden"`,最好给`StackPanel`添加一个合适的`Margin`,也是为了美观。
|
为了方便滚动,一般会在外层包一个`ScrollViewer`,同时为了美观,我们设置`ScrollViewer`的`VerticalScrollBarVisibility="Hidden"`,最好给`StackPanel`添加一个合适的`Margin`,也是为了美观。
|
||||||
|
|
||||||
## 基础用法
|
# 基础用法
|
||||||
|
|
||||||
第一步:将`StackPanel`设置为`Growl`的容器
|
第一步:将`StackPanel`设置为`Growl`的容器
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ title: Growl 信息通知
|
|||||||
例如:`Growl.Success("文件保存成功!");`
|
例如:`Growl.Success("文件保存成功!");`
|
||||||
{% endnote %}
|
{% endnote %}
|
||||||
|
|
||||||
## 只在激活中的窗口显示信息通知
|
# 只在激活中的窗口显示信息通知
|
||||||
|
|
||||||
为需要显示信息通知的窗口重写`OnActivated`和`OnDeactivated`方法,在`OnActivated`中调用`Growl.SetGrowlParent(GrowlPanel, true);`,在`OnDeactivated`中调用`Growl.SetGrowlParent(GrowlPanel, false);`
|
为需要显示信息通知的窗口重写`OnActivated`和`OnDeactivated`方法,在`OnActivated`中调用`Growl.SetGrowlParent(GrowlPanel, true);`,在`OnDeactivated`中调用`Growl.SetGrowlParent(GrowlPanel, false);`
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ title: Growl 信息通知
|
|||||||
这种情况下就不需要在xaml中设置`controls:Growl.GrowlParent="True"`了。
|
这种情况下就不需要在xaml中设置`controls:Growl.GrowlParent="True"`了。
|
||||||
{% endnote %}
|
{% endnote %}
|
||||||
|
|
||||||
## 在任意的`StackPanel`容器中显示信息通知
|
# 在任意的`StackPanel`容器中显示信息通知
|
||||||
|
|
||||||
第一步:为`StackPanel`容器赋予消息标记:SuccessMsg
|
第一步:为`StackPanel`容器赋予消息标记:SuccessMsg
|
||||||
``` xml
|
``` xml
|
||||||
@@ -75,20 +75,20 @@ title: Growl 信息通知
|
|||||||
现在"文件保存成功!"这则消息只会发送到拥有"SuccessMsg"消息标记的`StackPanel`容器中。
|
现在"文件保存成功!"这则消息只会发送到拥有"SuccessMsg"消息标记的`StackPanel`容器中。
|
||||||
{% endnote %}
|
{% endnote %}
|
||||||
|
|
||||||
## 属性
|
# 属性
|
||||||
|
|
||||||
|名称|说明|
|
|名称|说明|
|
||||||
|-|-|
|
|-|-|
|
||||||
| GrowlPanel | 当前使用的消息容器 |
|
| GrowlPanel | 当前使用的消息容器 |
|
||||||
|
|
||||||
## 附加属性
|
# 附加属性
|
||||||
|
|
||||||
|名称|说明|
|
|名称|说明|
|
||||||
|-|-|
|
|-|-|
|
||||||
| Token | 用于设置消息标记 |
|
| Token | 用于设置消息标记 |
|
||||||
| GrowlParent | 用于设置消息容器 |
|
| GrowlParent | 用于设置消息容器 |
|
||||||
|
|
||||||
## 方法
|
# 方法
|
||||||
|
|
||||||
|名称|说明|
|
|名称|说明|
|
||||||
|-|-|
|
|-|-|
|
||||||
@@ -116,7 +116,7 @@ title: Growl 信息通知
|
|||||||
| Clear( ) | 清空当前使用的消息容器中的消息 |
|
| Clear( ) | 清空当前使用的消息容器中的消息 |
|
||||||
| Clear(string) | 清空含有指定消息标记的消息容器中的消息 |
|
| Clear(string) | 清空含有指定消息标记的消息容器中的消息 |
|
||||||
|
|
||||||
## FAQ
|
# FAQ
|
||||||
|
|
||||||
{% note info no-icon %}
|
{% note info no-icon %}
|
||||||
Ask比较特殊,咋用?
|
Ask比较特殊,咋用?
|
||||||
|
|||||||
@@ -1,5 +1,44 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: Button 按钮
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# ButtonBaseStyle : ButtonBaseBaseStyle
|
||||||
|
|
||||||
|
默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||||
|
|
||||||
|
{% note info %}
|
||||||
|
所有继承此样式的按钮都可以使用`IconElement`中定义的附加属性来控制按钮中几何图形的属性。
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
{% note info %}
|
||||||
|
所有继承此样式的按钮都可以使用`BorderElement.CornerRadius`附加属性来控制按钮的圆角大小。
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# ButtonPrimary : ButtonBaseStyle
|
||||||
|
|
||||||
|
主要按钮
|
||||||
|
|
||||||
|
# ButtonSuccess : ButtonBaseStyle
|
||||||
|
|
||||||
|
成功按钮
|
||||||
|
|
||||||
|
# ButtonInfo : ButtonBaseStyle
|
||||||
|
|
||||||
|
信息按钮
|
||||||
|
|
||||||
|
# ButtonWarning : ButtonBaseStyle
|
||||||
|
|
||||||
|
警告按钮
|
||||||
|
|
||||||
|
# ButtonDanger : ButtonBaseStyle
|
||||||
|
|
||||||
|
危险操作按钮
|
||||||
|
|
||||||
|
# ButtonIcon : ButtonBaseStyle
|
||||||
|
|
||||||
|
如果只想显示几何图形按钮,则推荐使用此样式。
|
||||||
|
|
||||||
|
# ButtonCustom
|
||||||
|
|
||||||
|
如果想完全自定义按钮的内容,则推荐使用此样式。
|
||||||
|
|
||||||
@@ -2,4 +2,20 @@
|
|||||||
title: 原生控件
|
title: 原生控件
|
||||||
---
|
---
|
||||||
|
|
||||||
原生控件是指WPF框架自带的控件,除此之外,通过附加属性实现简单的功能扩展。
|
原生控件是指WPF框架自带的控件,除此之外,通过附加属性实现简单的功能扩展。
|
||||||
|
|
||||||
|
{% note warning %}
|
||||||
|
HandyControl中,几乎所有的原生控件都有默认实现的基样式(即定义样式的时候,没有显示给定Key值)。
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
{% note warning %}
|
||||||
|
基样式一般带有“Base”字样,不推荐用户直接在视图层中使用,合适的使用场景是资源文件。
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
# FAQ
|
||||||
|
|
||||||
|
{% note info no-icon %}
|
||||||
|
我该怎么覆盖样式的默认实现呢?没有Key可以给我BasedOn啊?
|
||||||
|
{% endnote %}
|
||||||
|
|
||||||
|
可以使用这种语法:`BasedOn="{StaticResource {x:Type Button}}"`来覆盖`Button`的默认样式。
|
||||||
Reference in new issue
Block a user