feat: initialize.

This commit is contained in:
rabbitism
2024-04-24 21:28:34 +08:00
parent dcb74432e9
commit 237bc0beb8

View File

@@ -0,0 +1,35 @@
using Avalonia;
using Avalonia.Controls.Primitives;
namespace Ursa.Controls.TimePicker;
public class TimePicker: TemplatedControl
{
public static readonly StyledProperty<string> DisplayFormatProperty = AvaloniaProperty.Register<TimePicker, string>(
nameof(DisplayFormat), defaultValue:"HH:mm:ss");
public string DisplayFormat
{
get => GetValue(DisplayFormatProperty);
set => SetValue(DisplayFormatProperty, value);
}
public static readonly StyledProperty<string> PanelPlacementProperty =
AvaloniaProperty.Register<TimePicker, string>(
nameof(PanelPlacement), defaultValue: "HH mm ss");
public string PanelPlacement
{
get => GetValue(PanelPlacementProperty);
set => SetValue(PanelPlacementProperty, value);
}
public static readonly StyledProperty<TimeSpan?> SelectedTimeProperty = AvaloniaProperty.Register<TimePicker, TimeSpan?>(
nameof(SelectedTime));
public TimeSpan? SelectedTime
{
get => GetValue(SelectedTimeProperty);
set => SetValue(SelectedTimeProperty, value);
}
}