update docs
This commit is contained in:
1 parent
b0e4b98827
commit
685bb075f2
9 files changed
+363
-14
No files matched your search
@@ -1,5 +1,49 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: TimeBar 时间条
|
||||
---
|
||||
|
||||
建设中
|
||||
一种包含热区和时间刻度的进度条.
|
||||
|
||||
```cs
|
||||
[TemplatePart(Name = ElementBorderTop, Type = typeof(Border))]
|
||||
[TemplatePart(Name = ElementTextBlockMove, Type = typeof(TextBlock))]
|
||||
[TemplatePart(Name = ElementTextBlockSelected, Type = typeof(TextBlock))]
|
||||
[TemplatePart(Name = ElementCanvasSpe, Type = typeof(Canvas))]
|
||||
[TemplatePart(Name = ElementHotspots, Type = typeof(Panel))]
|
||||
public class TimeBar : Control
|
||||
```
|
||||
|
||||
# 属性
|
||||
|
||||
|属性|描述|默认值|备注|
|
||||
|-|-|-|-|
|
||||
|Hotspots|热区集合|||
|
||||
|HotspotsBrush|热区颜色|||
|
||||
|ShowSpeStr|是否显示刻度|false||
|
||||
|TimeFormat|时间格式|yyyy-MM-dd HH:mm:ss||
|
||||
|SelectedTime|当前选中时间||||
|
||||
|
||||
# 事件
|
||||
|
||||
|名称|说明|
|
||||
|-|-|
|
||||
| TimeChanged | 选中时间改变时触发 |
|
||||
|
||||
# 案例
|
||||
|
||||
```xml
|
||||
<hc:TimeBar BorderThickness="0" Width="600"/>
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 设置热区
|
||||
|
||||
```cs
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var hour = 6 * i;
|
||||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(hour), DateTime.Today.AddHours(hour + 1)));
|
||||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(-hour), DateTime.Today.AddHours(-hour + 1)));
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user