From 0eb9bed3990b75ad46cae0ca8d8fe5270dfff968 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Mon, 15 Apr 2019 23:27:39 +0800 Subject: [PATCH] add doc --- .../extend_controls/growl/index.md | 18 ++++---- .../native_controls/button/index.md | 43 ++++++++++++++++++- .../handycontrol/native_controls/index.md | 18 +++++++- 3 files changed, 67 insertions(+), 12 deletions(-) diff --git a/doc/source/handycontrol/extend_controls/growl/index.md b/doc/source/handycontrol/extend_controls/growl/index.md index dd719d4e..acb67970 100644 --- a/doc/source/handycontrol/extend_controls/growl/index.md +++ b/doc/source/handycontrol/extend_controls/growl/index.md @@ -4,11 +4,11 @@ title: Growl 信息通知 当需要在窗口的右侧区域,以从上到下排列通知信息时可以使用本控件。 -## 控件效果 +# 控件效果 ![Growl](https://raw.githubusercontent.com/NaBian/HandyControl/master/Resources/Growl.gif) -## 准备工作 +# 准备工作 在指定的窗口右侧区域添加`StackPanel`容器 ``` xml @@ -18,7 +18,7 @@ title: Growl 信息通知 ``` 为了方便滚动,一般会在外层包一个`ScrollViewer`,同时为了美观,我们设置`ScrollViewer`的`VerticalScrollBarVisibility="Hidden"`,最好给`StackPanel`添加一个合适的`Margin`,也是为了美观。 -## 基础用法 +# 基础用法 第一步:将`StackPanel`设置为`Growl`的容器 @@ -37,7 +37,7 @@ title: Growl 信息通知 例如:`Growl.Success("文件保存成功!");` {% endnote %} -## 只在激活中的窗口显示信息通知 +# 只在激活中的窗口显示信息通知 为需要显示信息通知的窗口重写`OnActivated`和`OnDeactivated`方法,在`OnActivated`中调用`Growl.SetGrowlParent(GrowlPanel, true);`,在`OnDeactivated`中调用`Growl.SetGrowlParent(GrowlPanel, false);` @@ -53,7 +53,7 @@ title: Growl 信息通知 这种情况下就不需要在xaml中设置`controls:Growl.GrowlParent="True"`了。 {% endnote %} -## 在任意的`StackPanel`容器中显示信息通知 +# 在任意的`StackPanel`容器中显示信息通知 第一步:为`StackPanel`容器赋予消息标记:SuccessMsg ``` xml @@ -75,20 +75,20 @@ title: Growl 信息通知 现在"文件保存成功!"这则消息只会发送到拥有"SuccessMsg"消息标记的`StackPanel`容器中。 {% endnote %} -## 属性 +# 属性 |名称|说明| |-|-| | GrowlPanel | 当前使用的消息容器 | -## 附加属性 +# 附加属性 |名称|说明| |-|-| | Token | 用于设置消息标记 | | GrowlParent | 用于设置消息容器 | -## 方法 +# 方法 |名称|说明| |-|-| @@ -116,7 +116,7 @@ title: Growl 信息通知 | Clear( ) | 清空当前使用的消息容器中的消息 | | Clear(string) | 清空含有指定消息标记的消息容器中的消息 | -## FAQ +# FAQ {% note info no-icon %} Ask比较特殊,咋用? diff --git a/doc/source/handycontrol/native_controls/button/index.md b/doc/source/handycontrol/native_controls/button/index.md index ca12ad62..ada84134 100644 --- a/doc/source/handycontrol/native_controls/button/index.md +++ b/doc/source/handycontrol/native_controls/button/index.md @@ -1,5 +1,44 @@ --- -title: 建设中 +title: Button 按钮 --- -建设中 \ No newline at end of file +# 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 + +如果想完全自定义按钮的内容,则推荐使用此样式。 + diff --git a/doc/source/handycontrol/native_controls/index.md b/doc/source/handycontrol/native_controls/index.md index eeefb3ce..f5e900f0 100644 --- a/doc/source/handycontrol/native_controls/index.md +++ b/doc/source/handycontrol/native_controls/index.md @@ -2,4 +2,20 @@ title: 原生控件 --- -原生控件是指WPF框架自带的控件,除此之外,通过附加属性实现简单的功能扩展。 \ No newline at end of file +原生控件是指WPF框架自带的控件,除此之外,通过附加属性实现简单的功能扩展。 + +{% note warning %} +HandyControl中,几乎所有的原生控件都有默认实现的基样式(即定义样式的时候,没有显示给定Key值)。 +{% endnote %} + +{% note warning %} +基样式一般带有“Base”字样,不推荐用户直接在视图层中使用,合适的使用场景是资源文件。 +{% endnote %} + +# FAQ + +{% note info no-icon %} +我该怎么覆盖样式的默认实现呢?没有Key可以给我BasedOn啊? +{% endnote %} + +可以使用这种语法:`BasedOn="{StaticResource {x:Type Button}}"`来覆盖`Button`的默认样式。 \ No newline at end of file