1. 语法

1.1. XAML

2. 备注

2.1. 布局计算

TimeLine作为时间轴(横向坐标),其精度为毫秒。原点为StartDate,相对于原点的位置为某一时间点减去开始时间所得时间的毫秒数,即XPosition。

TimeLine布局计算继承自ILayout接口,主要依赖于XPosition,ViewPortWidth,ViewPortHeight属性。

出于性能考虑,TimeLine仅仅计算出当前ViewPortWidth和ViewPortHeight范围内的所需的单元格(表示时间段的方格)。

2.2. 渲染

TimeLine允许自定义Renderer的风格,自定义的Renderer类必须继承自ITimeLineEntryRenderer接口。可参考SimpleTimeLineEntryRenderer的实现。并指定TimeLine.ItemRendererProvider的值为自定义的Renderer类。

2.3. 放大/缩小

时间轴控件允许自定义放大缩小的层级,从而变换“年/季度”,“年/月”,“月/日”等不同样式。

设定放大缩小层级,必须了解Dictionary<IDateTimeDescriptor, int>和最小MinDateTimeRangeWidth 的定义。

1) Dictionary<IDateTimeDescriptor, int>

IDateTimeDescriptor表示TimeLine上同一时间轴上每个方块显示的时间范围,即一个单元时间范围,如下面的代码表示2季度:

   1:  
new SimpleDateTimeDescriptor(2, DateTimeType.Quarter)

相关文章:

  • 2021-11-18
  • 2021-11-18
  • 2021-11-18
  • 2021-11-18
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
相关资源
相似解决方案