// ReSharper disable once CheckNamespace namespace WPFluent.Controls; /// /// Represents a control that allows a user to pick a time value. /// public class TimePicker : System.Windows.Controls.Primitives.ButtonBase { /// /// Identifies the dependency property. /// public static readonly DependencyProperty ClockIdentifierProperty = DependencyProperty.Register( nameof(ClockIdentifier), typeof(TimeClockIdentifier), typeof(TimePicker), new PropertyMetadata(TimeClockIdentifier.Clock24Hour)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( nameof(Header), typeof(object), typeof(TimePicker), new PropertyMetadata(null)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty MinuteIncrementProperty = DependencyProperty.Register( nameof(MinuteIncrement), typeof(int), typeof(TimePicker), new PropertyMetadata(1)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty SelectedTimeProperty = DependencyProperty.Register( nameof(SelectedTime), typeof(TimeSpan?), typeof(TimePicker), new PropertyMetadata(null)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty TimeProperty = DependencyProperty.Register( nameof(Time), typeof(TimeSpan), typeof(TimePicker), new PropertyMetadata(TimeSpan.Zero)); /// /// Gets or sets the clock system to use. /// public TimeClockIdentifier ClockIdentifier { get => (TimeClockIdentifier)GetValue(ClockIdentifierProperty); set => SetValue(ClockIdentifierProperty, value); } /// /// Gets or sets the content for the control's header. /// public object Header { get => GetValue(HeaderProperty); set => SetValue(HeaderProperty, value); } /// /// Gets or sets a value that indicates the time increments shown in the minute picker. For example, 15 specifies /// that the TimePicker minute control displays only the choices 00, 15, 30, 45. /// public int MinuteIncrement { get => (int)GetValue(MinuteIncrementProperty); set => SetValue(MinuteIncrementProperty, value); } /// /// Gets or sets the time currently selected in the time picker /// public TimeSpan? SelectedTime { get => (TimeSpan?)GetValue(SelectedTimeProperty); set => SetValue(SelectedTimeProperty, value); } /// /// Gets or sets the time currently set in the time picker. /// public TimeSpan Time { get => (TimeSpan)GetValue(TimeProperty); set => SetValue(TimeProperty, value); } }