doc of attach/tipElement
doc of native_controls/listview,menu,passwordbox
This commit is contained in:
1 parent
38b060f02b
commit
bb3e379ed4
5 files changed
+182
-10
No files matched your search
@@ -1,5 +1,42 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: TipElement 提示元素
|
||||
---
|
||||
|
||||
建设中
|
||||
# 属性
|
||||
|
||||
| 名称 | 用途 |
|
||||
| ---------- | -------- |
|
||||
| Placement | 提示元素显示位置 |
|
||||
| Visibility | 是否可见 |
|
||||
|
||||
|
||||
# 使用案例
|
||||
|
||||
## Placement 提示元素显示位置
|
||||
|
||||
该属性,用于设定提示元素显示位置,目前支持BottomRight和TopLeft(默认值)
|
||||
|
||||
```
|
||||
<hc:RangeSlider Width="400"
|
||||
hc:TipElement.Visibility="Visible"
|
||||
TickPlacement="BottomRight"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100" ValueEnd="60"
|
||||
TickFrequency="10"
|
||||
Margin="0,32,0,0"/>
|
||||
<hc:RangeSlider Width="400"
|
||||
hc:TipElement.Visibility="Visible"
|
||||
hc:TipElement.Placement="BottomRight"
|
||||
TickPlacement="BottomRight"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="100" ValueEnd="60"
|
||||
TickFrequency="10"
|
||||
Margin="0,32,0,0"/>
|
||||
```
|
||||
|
||||
效果
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ListView 列表视图
|
||||
---
|
||||
|
||||
建设中
|
||||
`HandyControl`中仅仅提供了一个默认的`ListView`的资源样式,可根据个人需求,自行定义
|
||||
|
||||
# 案例
|
||||
|
||||
```
|
||||
<ListView ItemsSource="{Binding DataList}" Margin="20">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Width="80" Header="标题1" DisplayMemberBinding="{Binding Index}"/>
|
||||
<GridViewColumn Width="100" Header="标题2" DisplayMemberBinding="{Binding Name}"/>
|
||||
<GridViewColumn Width="200" Header="标题3" DisplayMemberBinding="{Binding Remark}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
```
|
||||
|
||||
|
||||
|
||||

|
||||
@@ -1,5 +1,82 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: Menu 菜单
|
||||
---
|
||||
|
||||
建设中
|
||||
# MenuBaseStyle
|
||||
|
||||
`HandyControl`中的菜单默认样式,一般不建议直接使用,而是选择继承,便于个人自定义风格
|
||||
|
||||
样式
|
||||
|
||||
```xml
|
||||
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem"/>
|
||||
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu"/>
|
||||
```
|
||||
|
||||
使用
|
||||
|
||||
```
|
||||
<Menu ItemsSource="{Binding Menus}">
|
||||
<Menu.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||
<TextBlock Text="{Binding Name}"></TextBlock>
|
||||
</HierarchicalDataTemplate>
|
||||
</Menu.ItemTemplate>
|
||||
</Menu>
|
||||
```
|
||||
|
||||
数据视图
|
||||
|
||||
```c#
|
||||
//菜单子项视图类
|
||||
public class MenuItemViewModel
|
||||
{
|
||||
public List<MenuItemViewModel> Children { get; set; }
|
||||
public MenuItemViewModel Parent { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
//菜单数据视图类
|
||||
public class MenuViewModel
|
||||
{
|
||||
public MenuViewModel()
|
||||
{
|
||||
Menus = new List<MenuItemViewModel>
|
||||
{
|
||||
new MenuItemViewModel
|
||||
{
|
||||
Name="一级菜单",
|
||||
Children = new List<MenuItemViewModel>{
|
||||
new MenuItemViewModel{
|
||||
Name="二级菜单"
|
||||
}
|
||||
}
|
||||
},
|
||||
new MenuItemViewModel
|
||||
{
|
||||
Name="一级菜单",
|
||||
Children = new List<MenuItemViewModel>{
|
||||
new MenuItemViewModel{
|
||||
Name="二级菜单"
|
||||
}
|
||||
}
|
||||
},
|
||||
new MenuItemViewModel
|
||||
{
|
||||
Name="一级菜单",
|
||||
Children = new List<MenuItemViewModel>{
|
||||
new MenuItemViewModel{
|
||||
Name="二级菜单"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
public List<MenuItemViewModel> Menus { get; set; }
|
||||
}
|
||||
```
|
||||
|
||||
效果
|
||||
|
||||

|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: PasswordBox 密码框
|
||||
---
|
||||
|
||||
建设中
|
||||
# PasswordBoxBaseStyle
|
||||
|
||||
控件默认样式,该样式不建议直接使用,而是选择继承的方式进行个人控件样式的处理,参考在线资源[PasswordBoxBaseStyle](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControl_Shared/Themes/Styles/Base/PasswordBoxBaseStyle.xaml)
|
||||
|
||||
```
|
||||
<Style BasedOn="{StaticResource PasswordBoxBaseStyle}" TargetType="PasswordBox"/>
|
||||
```
|
||||
|
||||
使用
|
||||
|
||||
```
|
||||
<PasswordBox PasswordChar="*"
|
||||
VerticalAlignment="Center"
|
||||
Width="120"></PasswordBox>
|
||||
```
|
||||
|
||||
效果
|
||||
|
||||

|
||||
|
||||
# PasswordBoxExtendBaseStyle
|
||||
|
||||
控件拓展基础样式,是样式`PasswordBoxExtend`的基本样式,不建议直接使用,而是选择使用`PasswordBoxExtend`,该样式支持添加`PasswordBox`专用附加属性`PasswordBoxAttach`、额外信息元素`InfoElement`和标题元素`TitleElement`
|
||||
|
||||
```
|
||||
<!--为使普通密码输入文本框显示水印,需要设定PasswordBoxAttach.PasswordLength="0"-->
|
||||
<PasswordBox Style="{DynamicResource PasswordBoxExtend}" PasswordChar="*"
|
||||
hc:PasswordBoxAttach.PasswordLength="0"
|
||||
hc:InfoElement.Placeholder="请输入密码"
|
||||
VerticalAlignment="Center"
|
||||
Width="120"></PasswordBox>
|
||||
<PasswordBox Style="{DynamicResource PasswordBoxExtend}" PasswordChar="*"
|
||||
hc:TitleElement.Title="用户密码:"
|
||||
hc:TitleElement.TitleAlignment="Top"
|
||||
VerticalAlignment="Center"
|
||||
Width="120"></PasswordBox>
|
||||
```
|
||||
|
||||
效果
|
||||
|
||||

|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ProgressBar 进度条
|
||||
---
|
||||
|
||||
建设中
|
||||
Reference in new issue
Block a user