Merge branch 'master' into pr/258
This commit is contained in:
commit
1fef31fbd2
3 files changed
+96
-102
No files matched your search
@@ -2,27 +2,17 @@
|
|||||||
title: Image图片
|
title: Image图片
|
||||||
---
|
---
|
||||||
|
|
||||||
在`HandyControl`中,对应原生的`Image`控件,仅仅提供了一个默认的控件样式,并未提供特殊样式,对于个性化定制,需要使用者自行定制
|
在`HandyControl`中,对应原生的`Image`控件,仅仅提供了一个默认的控件样式,并未提供特殊样式,对于个性化定制,需要使用者自行定制。
|
||||||
|
|
||||||
默认样式定义:
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
```
|
{% code %}
|
||||||
<Style TargetType="Image">
|
|
||||||
<!--设定图片的长宽分布为均匀分布-->
|
|
||||||
<Setter Property="Stretch" Value="Uniform" />
|
|
||||||
<!--设置图片缩放模式为高质量位图缩放-->
|
|
||||||
<Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality" />
|
|
||||||
</Style>
|
|
||||||
```
|
|
||||||
|
|
||||||
案例:
|
|
||||||
|
|
||||||
```
|
|
||||||
<StackPanel Background="LightGray">
|
<StackPanel Background="LightGray">
|
||||||
<Image Source="Resources/Images/Image_basestyle.png" Margin="0,10"></Image>
|
<Image Source="Resources/Images/Image_basestyle.png" Margin="0,10"></Image>
|
||||||
<Image Source="Resources/Images/Image_basestyle.png" RenderOptions.BitmapScalingMode="HighQuality" Stretch="Uniform"></Image>
|
<Image Source="Resources/Images/Image_basestyle.png" RenderOptions.BitmapScalingMode="HighQuality" Stretch="Uniform"></Image>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
```
|
{% endcode %}
|
||||||
|
|
||||||

|

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

|

|
||||||
|
|
||||||
# LabelPrimary
|
{% endnote %}
|
||||||
|
|
||||||
Label标签 主样式
|
# LabelPrimary : LabelBaseStyle
|
||||||
|
|
||||||
案例:
|
主样式
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
<Label Content="LabelPrimary样式" Margin="10"
|
用例:
|
||||||
Style="{DynamicResource LabelPrimary}"></Label>
|
{% code %}
|
||||||
```
|
<Label Content="LabelPrimary样式" Margin="10" Style="{DynamicResource LabelPrimary}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# LabelSuccess
|
{% endnote %}
|
||||||
|
|
||||||
Label标签 成功类型样式
|
# LabelSuccess : LabelBaseStyle
|
||||||
|
|
||||||
案例:
|
成功类型样式
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
<Label Content="LabelSuccess样式" Margin="10"
|
用例:
|
||||||
Style="{DynamicResource LabelSuccess}"></Label>
|
{% code %}
|
||||||
```
|
<Label Content="LabelSuccess样式" Margin="10" Style="{DynamicResource LabelSuccess}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# LabelInfo
|
{% endnote %}
|
||||||
|
|
||||||
Label标签 信息类型样式
|
# LabelInfo : LabelBaseStyle
|
||||||
|
|
||||||
案例:
|
信息类型样式
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
<Label Content="LabelInfo样式" Margin="10"
|
用例:
|
||||||
Style="{DynamicResource LabelInfo}"></Label>
|
{% code %}
|
||||||
```
|
<Label Content="LabelInfo样式" Margin="10" Style="{DynamicResource LabelInfo}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# LabelWarning
|
{% endnote %}
|
||||||
|
|
||||||
Label标签 警告类型样式
|
# LabelWarning : LabelBaseStyle
|
||||||
|
|
||||||
案例:
|
警告类型样式
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
<Label Content="LabelWarning样式" Margin="10"
|
用例:
|
||||||
Style="{DynamicResource LabelWarning}"></Label>
|
{% code %}
|
||||||
```
|
<Label Content="LabelWarning样式" Margin="10" Style="{DynamicResource LabelWarning}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# LabelDanger
|
{% endnote %}
|
||||||
|
|
||||||
Label标签 危险类型样式
|
# LabelDanger : LabelBaseStyle
|
||||||
|
|
||||||
```
|
危险类型样式
|
||||||
<Label Content="LabelDanger样式" Margin="10"
|
|
||||||
Style="{DynamicResource LabelDanger}"></Label>
|
{% note info no-icon %}
|
||||||
```
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<Label Content="LabelDanger样式" Margin="10" Style="{DynamicResource LabelDanger}"></Label>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||

|

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

|

|
||||||
|
|
||||||
# ListBoxCustom
|
{% endnote %}
|
||||||
|
|
||||||
ListBox列表Custom样式,该样式保留了Listbox的基本属性样式,而数据显示样式由当前用户自定义,实现个性化定制
|
# ListBoxCustom : ListBoxBaseStyle
|
||||||
|
|
||||||
案例:
|
ListBox列表Custom样式,该样式保留了Listbox的基本属性样式,而数据显示样式由当前用户自定义,实现个性化定制。
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
Style="{DynamicResource ListBoxCustom}">
|
Style="{DynamicResource ListBoxCustom}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
@@ -37,20 +36,20 @@ ListBox列表Custom样式,该样式保留了Listbox的基本属性样式,而
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
```
|
{% endcode %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# WrapPanelHorizontalListBox
|
{% endnote %}
|
||||||
|
|
||||||
ListBox列表显示布局容器为WrapPanel,水平方向显示样式
|
# WrapPanelHorizontalListBox : ListBoxCustom
|
||||||
|
|
||||||
案例:
|
布局容器为WrapPanel,水平方向显示样式。
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
用例:
|
||||||
|
{% code %}
|
||||||
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
Style="{DynamicResource WrapPanelHorizontalListBox}">
|
Style="{DynamicResource WrapPanelHorizontalListBox}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@@ -63,17 +62,19 @@ ListBox列表显示布局容器为WrapPanel,水平方向显示样式
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
```
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# WrapPanelVerticalListBox
|
{% endnote %}
|
||||||
|
|
||||||
ListBox列表显示布局容器为WrapPanel,垂直方向显示样式
|
# WrapPanelVerticalListBox : ListBoxCustom
|
||||||
|
|
||||||
案例:
|
布局容器为WrapPanel,垂直方向显示样式。
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
Style="{DynamicResource WrapPanelVerticalListBox}">
|
Style="{DynamicResource WrapPanelVerticalListBox}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
@@ -87,17 +88,19 @@ ListBox列表显示布局容器为WrapPanel,垂直方向显示样式
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
```
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# StackPanelHorizontalListBox
|
{% endnote %}
|
||||||
|
|
||||||
ListBox列表显示布局容器为StackPanel,水平方向显示样式
|
# StackPanelHorizontalListBox : ListBoxCustom
|
||||||
|
|
||||||
案例:
|
布局容器为StackPanel,水平方向显示样式。
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
Style="{DynamicResource StackPanelHorizontalListBox}">
|
Style="{DynamicResource StackPanelHorizontalListBox}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
@@ -111,17 +114,19 @@ ListBox列表显示布局容器为StackPanel,水平方向显示样式
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
```
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# StackPanelVerticalListBox
|
{% endnote %}
|
||||||
|
|
||||||
ListBox列表显示布局容器为StackPanel,垂直方向显示样式
|
# StackPanelVerticalListBox : ListBoxCustom
|
||||||
|
|
||||||
案例:
|
布局容器为StackPanel,垂直方向显示样式。
|
||||||
|
|
||||||
```
|
{% note info no-icon %}
|
||||||
|
用例:
|
||||||
|
{% code %}
|
||||||
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
<ListBox Margin="10" ItemsSource="{Binding Datas}"
|
||||||
Style="{DynamicResource StackPanelVerticalListBox}">
|
Style="{DynamicResource StackPanelVerticalListBox}">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
@@ -135,6 +140,8 @@ ListBox列表显示布局容器为StackPanel,垂直方向显示样式
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
```
|
{% endcode %}
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
{% endnote %}
|
||||||
Reference in new issue
Block a user