Separate version

This commit is contained in:
NaBian committed 2019-01-21 11:12:38 +08:00
1 parent a2574dc955
commit db61ae9567
587 files changed
+44639 -657

No files matched your search

@@ -0,0 +1,51 @@
using System;
using System.Windows.Controls;
namespace HandyControl.Controls
{
/// <summary>
/// 作为刻度使用的文字块
/// </summary>
internal class SpeTextBlock : TextBlock
{
public double X { get; set; }
public SpeTextBlock() => Width = 60;
public SpeTextBlock(double x) : this()
{
X = x;
Canvas.SetLeft(this, X);
}
/// <summary>
/// 时间
/// </summary>
private DateTime _time;
/// <summary>
/// 时间
/// </summary>
public DateTime Time
{
get => _time;
set
{
_time = value;
Text = $"{value.ToString(TimeFormat)}\r\n|";
}
}
/// <summary>
/// 时间格式
/// </summary>
public string TimeFormat { get; set; } = "HH:mm";
/// <summary>
/// 横向移动
/// </summary>
/// <param name="offsetX"></param>
public void MoveX(double offsetX) => Canvas.SetLeft(this, X + offsetX);
}
}