update doc
No files matched your search
|
After Width: | Height: | Size: 11 KiB |
@@ -1,5 +1,9 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: 附加属性
|
||||
---
|
||||
|
||||
建设中
|
||||
附加属性源码在Controls / Attach文件夹中:
|
||||
|
||||

|
||||
|
||||
以`Element`结尾的类,可以为所有的控件设置一些共有的属性,以`Attach`结尾的类,只能为一种控件设置相关的属性。
|
||||
@@ -14,5 +14,5 @@ title: 行为
|
||||
| BehaviorY400 | 流体移动行为,y轴运动,400毫秒结束动画 |
|
||||
|
||||
{% note info no-icon %}
|
||||
用例:`controls:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"`
|
||||
用例:`hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"`
|
||||
{% endnote %}
|
||||
@@ -4,12 +4,15 @@ title: 欢迎使用HandyControl
|
||||
|
||||
HandyControl是一套WPF控件库,它几乎重写了所有原生样式,同时包含50多款额外的控件(正逐步增加)。
|
||||
|
||||
# 使用要求
|
||||
# 要求
|
||||
|
||||
- .Net >= 4.0
|
||||
- OS >= win7
|
||||
- IDE >= vs2019
|
||||
- C# >= 7.3
|
||||
- 使用要求
|
||||
.Net >= 4.0
|
||||
OS >= win7
|
||||
|
||||
- 编译要求
|
||||
IDE >= vs2019
|
||||
C# >= 7.3
|
||||
|
||||
# 下载
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -1,5 +1,30 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: 国际化
|
||||
---
|
||||
|
||||
建设中
|
||||
# 使用方式
|
||||
|
||||
可通过`ConfigHelper.Instance.SetLang(string lang)`指定需要使用的语言包,默认使用zh-cn。
|
||||
|
||||
控件库自带的语言包一般为控件库内部使用,但用户也可以通过以下两种方式使用:
|
||||
|
||||
- xaml
|
||||
第一步,引入命名空间:`xmlns:hc="https://handyorg.github.io/handycontrol"`
|
||||
第二步,使用语言包:`<TextBlock Text="{x:Static hc:Lang.Cancel}"/>`
|
||||
|
||||
- C#
|
||||
`HandyControl.Properties.Langs.Lang.Cancel`
|
||||
|
||||
{% note warning %}
|
||||
控件库不支持动态语言包切换,未来也不会有支持。
|
||||
{% endnote %}
|
||||
|
||||
# 扩展
|
||||
|
||||
控件库自带zh-cn和en两份语言包,默认为zh-cn:
|
||||
|
||||

|
||||
|
||||
如果需要可自行扩展,这里推荐使用开源插件:[ResXManager](https://marketplace.visualstudio.com/items?itemName=TomEnglert.ResXManager),来维护所有的语言包。
|
||||
|
||||
引用控件库后,会在运行目录生成语言包文件夹,其命名方式形如zh-cn、en等。
|
||||
@@ -4,16 +4,40 @@ title: ComboBox 组合框
|
||||
|
||||
# ComboBoxBaseStyle
|
||||
|
||||
原生组合框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
原生组合框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。原生组合框如果未设置任何样式,则默认使用该样式:
|
||||
|
||||
- 默认样式
|
||||
`<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0"/>`
|
||||

|
||||
|
||||
# ComboBoxExtendBaseStyle : ComboBoxBaseStyle
|
||||
|
||||
原生组合框扩展默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
# ComboBoxPlusBaseStyle : ComboBoxExtendBaseStyle
|
||||
|
||||
扩展组合框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
# ComboBoxExtend : ComboBoxExtendBaseStyle
|
||||
|
||||
相对于原生组合框默认样式,它借助于附加属性可以实现标题、水印的功能。
|
||||
相对于原生组合框默认样式,它借助于附加属性可以实现标题、水印的功能。
|
||||
|
||||
- 标题在上
|
||||
`<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" hc:InfoElement.Title="这是标题" Style="{StaticResource ComboBoxExtend}" Text="正文1"/>`
|
||||

|
||||
|
||||
- 标题在左
|
||||
`<ComboBox ItemsSource="{Binding DataList}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitleAlignment="Left" hc:InfoElement.Title="标题在左侧" Style="{StaticResource ComboBoxExtend}" Text="正文1"/>`
|
||||

|
||||
|
||||
{% note warning %}
|
||||
标题在左时,为了多个输入框左侧对齐,需要设置标题宽度,标题宽度无需逐个设置,可在外部容器上统一设置。
|
||||
{% endnote %}
|
||||
|
||||
- 标题在上,带有水印
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}"/>`
|
||||

|
||||
|
||||
- 标题在上,带有水印,且为必填
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True"/>`
|
||||

|
||||
|
||||
- 标题在上,带有水印,且为必填,同时自定义必填提示符
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" hc:InfoElement.Symbol="*"/>`
|
||||

|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ContentControl 内容控件
|
||||
---
|
||||
|
||||
建设中
|
||||
所有的`ContentControl`默认无法获得焦点
|
||||
@@ -1,5 +1,22 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ContextMenu 上下文菜单
|
||||
---
|
||||
|
||||
建设中
|
||||
# ContextMenuBaseStyle
|
||||
|
||||
上下文菜单默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
{% note info no-icon %}
|
||||
用例:
|
||||
|
||||
{% code %}
|
||||
<ContextMenu ItemsSource="{Binding DataList}">
|
||||
<ContextMenu.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding DataList}">
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</HierarchicalDataTemplate>
|
||||
</ContextMenu.ItemTemplate>
|
||||
</ContextMenu>
|
||||
{% endcode %}
|
||||

|
||||
{% endnote %}
|
||||
@@ -1,5 +1,32 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: DataGrid 数据表格
|
||||
---
|
||||
|
||||
建设中
|
||||
{% note info no-icon %}
|
||||
用例:
|
||||
|
||||
{% code %}
|
||||
<DataGrid HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Width="80" CanUserResize="False" Binding="{Binding Index}" Header="{x:Static langs:Lang.Index}"/>
|
||||
<DataGridTemplateColumn Width="60" CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image Source="{Binding ImgPath}" Width="32" Height="32" Stretch="Uniform"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Width="1*" Binding="{Binding Name}" Header="{x:Static langs:Lang.Name}"/>
|
||||
<DataGridCheckBoxColumn Width="100" CanUserResize="False" Binding="{Binding IsSelected}" Header="{x:Static langs:Lang.Selected}"/>
|
||||
<DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource DemoTypes}}" Width="100" CanUserResize="False" SelectedValueBinding="{Binding Type}" Header="{x:Static langs:Lang.Type}"/>
|
||||
<DataGridTextColumn Width="1*" Binding="{Binding Remark}" Header="{x:Static langs:Lang.Remark}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
{% endcode %}
|
||||

|
||||
{% endnote %}
|
||||
@@ -1,5 +1,38 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: DatePicker 日期选择器
|
||||
---
|
||||
|
||||
建设中
|
||||
# DatePickerBaseStyle
|
||||
|
||||
原生日期选择器默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。原生日期选择器如果未设置任何样式,则默认使用该样式:
|
||||
|
||||
- 默认样式
|
||||
`<DatePicker SelectedDate="{x:Static system:DateTime.Now}"/>`
|
||||

|
||||
|
||||
# DatePickerExtendBaseStyle : DatePickerBaseStyle
|
||||
|
||||
原生日期选择器扩展默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
# DatePickerExtend : DatePickerExtendBaseStyle
|
||||
|
||||
- 标题在上
|
||||
`<DatePicker SelectedDate="{x:Static system:DateTime.Now}" Style="{StaticResource DatePickerExtend}" hc:InfoElement.Title="这是标题"/>`
|
||||

|
||||
|
||||
- 标题在左
|
||||
`<DatePicker SelectedDate="{x:Static system:DateTime.Now}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitleAlignment="Left" Style="{StaticResource DatePickerExtend}" hc:InfoElement.Title="标题在左侧"/>`
|
||||

|
||||
|
||||
{% note warning %}
|
||||
标题在左时,为了多个输入框左侧对齐,需要设置标题宽度,标题宽度无需逐个设置,可在外部容器上统一设置。
|
||||
{% endnote %}
|
||||
|
||||
- 标题在上,带有水印
|
||||
[参见Combobox](../combobox)
|
||||
|
||||
- 标题在上,带有水印,且为必填
|
||||
[参见Combobox](../combobox)
|
||||
|
||||
- 标题在上,带有水印,且为必填,同时自定义必填提示符
|
||||
[参见Combobox](../combobox)
|
||||
|
After Width: | Height: | Size: 885 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: 快速开始
|
||||
---
|
||||
|
||||
# 第一步
|
||||
下载源码或者以Nuget的方式引用控件库。
|
||||
源码链接:[HandyControl-Github](https://github.com/HandyOrg/HandyControl)
|
||||
Nuget链接:[HandyControl-Nuget](https://www.nuget.org/packages/HandyControl/)
|
||||
|
||||
# 第二步
|
||||
在App.xaml中添加以下代码:
|
||||
|
||||
``` xml
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
```
|
||||
|
||||
# 第三步
|
||||
添加命名空间:`xmlns:hc="https://handyorg.github.io/handycontrol"`
|
||||