update doc

This commit is contained in:
NaBian committed 2020-07-24 00:10:06 +08:00
1 parent f45aa5471c
commit 50776441ef
9 files changed
+136 -24

No files matched your search

@@ -49,7 +49,7 @@ public class AnimationPath : Shape
设置动画重复行为,默认为`Forever`,可根据需要设置重复行为。
## 继承至Shape常用属性
## 继承自Shape常用属性
| 属性名称 | 用途 |
| --------------- | -------- |
@@ -1,5 +1,54 @@
---
title: 建设中
title: Carousel 轮播
---
建设中
可以在固定时间内循环切换项目。
```c#
public class Carousel : SimpleItemsControl, IDisposable
```
# 属性
| 属性 | 用途 |
| ---------------------- | ------------------------------|
| AutoRun | 是否自动轮播 |
| Interval | 轮播间隔时间 |
| ExtendWidth | 项内容扩展宽度 |
| IsCenter | 轮播项是否居中显示 |
| PageButtonStyle | 页按钮样式 |
# 案例
## 显示填充轮播项
```xml
<hc:Carousel Margin="32" IsCenter="True" AutoRun="True" Width="600" Height="330" VerticalAlignment="Center">
<Image Width="600" Stretch="UniformToFill" Source="/HandyControlDemo;component/Resources/Img/1.jpg"/>
<Image Width="300" Stretch="UniformToFill" Source="/HandyControlDemo;component/Resources/Img/2.jpg"/>
<hc:SimplePanel Width="600">
<Image Stretch="UniformToFill" Source="/HandyControlDemo;component/Resources/Img/3.jpg"/>
<TextBlock Text="Demo Text" Style="{StaticResource TextBlockDefault}" FontSize="100" FontWeight="Bold" Foreground="White"/>
</hc:SimplePanel>
<Image Width="600" Stretch="UniformToFill" Source="/HandyControlDemo;component/Resources/Img/4.jpg"/>
<Image Width="600" Stretch="UniformToFill" Source="/HandyControlDemo;component/Resources/Img/5.jpg"/>
</hc:Carousel>
```
![Carousel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Carousel.gif)
## 使用绑定生成轮播项
```xml
<hc:Carousel AutoRun="True" ItemsSource="{Binding Images}" Width="300" Height="200">
<hc:Carousel.ItemTemplate>
<DataTemplate>
<Image Source="{Binding}" Width="300"/>
</DataTemplate>
</hc:Carousel.ItemTemplate>
</hc:Carousel>
```
{% note info %}
`ExtendWidth`会在最后一个轮播项后扩展一段距离,请注意,这不是偏移的概念,而是扩展的概念。
{% endnote %}
@@ -1,5 +1,24 @@
---
title: 建设中
title: ChatBubble 对话气泡
---
建设中
对话气泡常出现于通讯类软件中,相对于纯文本形式的上下文对话,使用对话气泡可以让聊天界面更加生动有趣。通过扩展,还可以做出气泡皮肤,可使软件个性化功能更加丰富。
```c#
public class ChatBubble : SelectableItem
```
# 属性
| 属性 | 用途 |
| ---------------------- | -------------------|
| Role | 对话角色 |
| Type | 消息类型 |
| IsRead | 是否已读 |
| ReadAction | 该气泡被选中时触发 |
![ChatBubble](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/ChatBubble.png)
{% note warning %}
效果代码详见源码demo
{% endnote %}
@@ -1,5 +1,61 @@
---
title: 建设中
title: CirclePanel 圆形布局
---
建设中
圆形布局常用作方向按钮、功能按钮的容器。
```c#
public class CirclePanel : Panel
```
# 属性
| 属性 | 用途 |
| ---------------------- | ------------------------------|
| Diameter | 直径 |
| KeepVertical | 元素是否保持垂直 |
| OffsetAngle | 整体的角度偏移 |
# 案例
```xml
<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
<Setter Property="UseLayoutRounding" Value="False"/>
<Setter Property="Height" Value="77"/>
<Setter Property="Width" Value="36.06"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<hc:SimplePanel>
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06"/>
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White"/>
</hc:SimplePanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" Value=".6"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<hc:CirclePanel Margin="64" Diameter="170">
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
<Button Style="{StaticResource CirclePanelButton}"/>
</hc:CirclePanel>
```
![CirclePanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/CirclePanel.jpg)