add doc of native_control/Label,Listbox
This commit is contained in:
1 parent
8526d341e2
commit
38b060f02b
3 files changed
+249
-6
No files matched your search
@@ -1,5 +1,28 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: Image图片
|
||||
---
|
||||
|
||||
建设中
|
||||
在`HandyControl`中,对应原生的`Image`控件,仅仅提供了一个默认的控件样式,并未提供特殊样式,对于个性化定制,需要使用者自行定制
|
||||
|
||||
默认样式定义:
|
||||
|
||||
```
|
||||
<Style TargetType="Image">
|
||||
<!--设定图片的长宽分布为均匀分布-->
|
||||
<Setter Property="Stretch" Value="Uniform" />
|
||||
<!--设置图片缩放模式为高质量位图缩放-->
|
||||
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality" />
|
||||
</Style>
|
||||
```
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<StackPanel Background="LightGray">
|
||||
<Image Source="Resources/Images/Image_basestyle.png" Margin="0,10"></Image>
|
||||
<Image Source="Resources/Images/Image_basestyle.png" RenderOptions.BitmapScalingMode="HighQuality" Stretch="Uniform"></Image>
|
||||
</StackPanel>
|
||||
```
|
||||
|
||||

|
||||
|
||||
@@ -1,5 +1,90 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: Lable标签
|
||||
---
|
||||
|
||||
建设中
|
||||
# LabelBaseStyle
|
||||
|
||||
Label标签 默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用,
|
||||
|
||||
具体源码见:[LabelBaseStyle.xaml]( https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControl_Shared/Themes/Styles/Base/LabelBaseStyle.xaml )
|
||||
|
||||
使用如下:
|
||||
|
||||
```
|
||||
<Style BasedOn="{StaticResource LabelBaseStyle}" TargetType="Label">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
</Style>
|
||||
```
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<Label Content="Label默认样式" Margin="10"></Label>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# LabelPrimary
|
||||
|
||||
Label标签 主样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<Label Content="LabelPrimary样式" Margin="10"
|
||||
Style="{DynamicResource LabelPrimary}"></Label>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# LabelSuccess
|
||||
|
||||
Label标签 成功类型样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<Label Content="LabelSuccess样式" Margin="10"
|
||||
Style="{DynamicResource LabelSuccess}"></Label>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# LabelInfo
|
||||
|
||||
Label标签 信息类型样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<Label Content="LabelInfo样式" Margin="10"
|
||||
Style="{DynamicResource LabelInfo}"></Label>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# LabelWarning
|
||||
|
||||
Label标签 警告类型样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<Label Content="LabelWarning样式" Margin="10"
|
||||
Style="{DynamicResource LabelWarning}"></Label>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# LabelDanger
|
||||
|
||||
Label标签 危险类型样式
|
||||
|
||||
```
|
||||
<Label Content="LabelDanger样式" Margin="10"
|
||||
Style="{DynamicResource LabelDanger}"></Label>
|
||||
```
|
||||
|
||||

|
||||
|
||||
@@ -1,5 +1,140 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ListBox 列表框
|
||||
---
|
||||
|
||||
建设中
|
||||
# ListBoxBaseStyle
|
||||
|
||||
ListBox默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用,
|
||||
|
||||
样式源码见[ListBoxBaseStyle.xaml](https://github.com/HandyOrg/HandyControl/blob/master/src/Shared/HandyControl_Shared/Themes/Styles/Base/ListBoxBaseStyle.xaml )。
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<!--默认样式-->
|
||||
<Style BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox"/>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# ListBoxCustom
|
||||
|
||||
ListBox列表Custom样式,该样式保留了Listbox的基本属性样式,而数据显示样式由当前用户自定义,实现个性化定制
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||
Style="{DynamicResource ListBoxCustom}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Black" Margin="0,5">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
```
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
# WrapPanelHorizontalListBox
|
||||
|
||||
ListBox列表显示布局容器为WrapPanel,水平方向显示样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||
Style="{DynamicResource WrapPanelHorizontalListBox}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Black" Margin="5,0">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# WrapPanelVerticalListBox
|
||||
|
||||
ListBox列表显示布局容器为WrapPanel,垂直方向显示样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||
Style="{DynamicResource WrapPanelVerticalListBox}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Black" Margin="0,5">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# StackPanelHorizontalListBox
|
||||
|
||||
ListBox列表显示布局容器为StackPanel,水平方向显示样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||
Style="{DynamicResource StackPanelHorizontalListBox}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Black" Margin="5,0">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
```
|
||||
|
||||

|
||||
|
||||
# StackPanelVerticalListBox
|
||||
|
||||
ListBox列表显示布局容器为StackPanel,垂直方向显示样式
|
||||
|
||||
案例:
|
||||
|
||||
```
|
||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||
Style="{DynamicResource StackPanelVerticalListBox}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderThickness="1" BorderBrush="Black" Margin="0,1">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Path DockPanel.Dock="Left" Fill="YellowGreen" Width="20" Margin="10,0,10,0" HorizontalAlignment="Center" Data="{DynamicResource BubbleTailGeometry}"></Path>
|
||||
<TextBlock Padding="10" Text="{Binding Name}"></TextBlock>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
```
|
||||
|
||||

|
||||
Reference in new issue
Block a user