feat: initialize panel.

This commit is contained in:
rabbitism
2024-04-24 23:17:49 +08:00
parent 237bc0beb8
commit 294d066bbd
3 changed files with 37 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
namespace Ursa.Controls.Panels;
/// <summary>
/// The panel to display items for time selection
/// </summary>
public class UrsaTimePickerPanel: Panel
{
/// <summary>
/// Defines whether the panel is looping.
/// This is ont applicable for columns like year and AM/PM designation.
/// </summary>
public static readonly StyledProperty<bool> IsLoopingProperty = AvaloniaProperty.Register<UrsaTimePickerPanel, bool>(
nameof(IsLooping));
/// <summary>
/// Gets or sets the value of <see cref="IsLoopingProperty"/>.
/// </summary>
public bool IsLooping
{
get => GetValue(IsLoopingProperty);
set => SetValue(IsLoopingProperty, value);
}
}

View File

@@ -32,4 +32,13 @@ public class TimePicker: TemplatedControl
get => GetValue(SelectedTimeProperty);
set => SetValue(SelectedTimeProperty, value);
}
public static readonly StyledProperty<bool> NeedConfirmProperty = AvaloniaProperty.Register<TimePicker, bool>(
nameof(NeedConfirm));
public bool NeedConfirm
{
get => GetValue(NeedConfirmProperty);
set => SetValue(NeedConfirmProperty, value);
}
}