TimePickerBase Class
Represents a base-class for time picking.
Namespace
MahApps.Metro.Controls
Base Types
  • Control
Derived Types
graph BT Type-->Base0["Control"] Type["TimePickerBase"] class Type type-node Derived0["TimePicker"]-->Type click Derived0 "/mahapps.com/api/MahApps.Metro.Controls/TimePicker" Derived1["DateTimePicker"]-->Type click Derived1 "/mahapps.com/api/MahApps.Metro.Controls/DateTimePicker"

Syntax

[TemplatePart(Name = ElementButton, Type = typeof(Button))]
[TemplatePart(Name = ElementHourHand, Type = typeof(UIElement))]
[TemplatePart(Name = ElementHourPicker, Type = typeof(Selector))]
[TemplatePart(Name = ElementMinuteHand, Type = typeof(UIElement))]
[TemplatePart(Name = ElementSecondHand, Type = typeof(UIElement))]
[TemplatePart(Name = ElementSecondPicker, Type = typeof(Selector))]
[TemplatePart(Name = ElementMinutePicker, Type = typeof(Selector))]
[TemplatePart(Name = ElementAmPmSwitcher, Type = typeof(Selector))]
[TemplatePart(Name = ElementTextBox, Type = typeof(DatePickerTextBox))]
[TemplatePart(Name = ElementPopup, Type = typeof(Popup))]
[DefaultEvent("SelectedDateTimeChanged")]
public abstract class TimePickerBase : Control

Attributes

Type Description
TemplatePart
TemplatePart
TemplatePart
TemplatePart
TemplatePart
TemplatePart
TemplatePart
TemplatePart
TemplatePart
TemplatePart
DefaultEvent

Constructors

Name Summary
TimePickerBase()

Events

Name Type Summary
SelectedDateTimeChanged RoutedPropertyChangedEventHandler<DateTime?>
Occurs when the SelectedDateTime property is changed.

Fields

Name Field Type Constant Value Summary
CultureProperty DependencyProperty
Identifies the Culture dependency property.
static
HandVisibilityProperty DependencyProperty
Identifies the HandVisibility dependency property.
static
hourInput Selector
HoursItemStringFormatProperty DependencyProperty
Identifies the HoursItemStringFormat dependency property.
static
IntervalOf10 IEnumerable<int>
This list contains values from 0 to 50 with an interval of 10. It can be used to bind to SourceMinutes and SourceSeconds.
static
IntervalOf15 IEnumerable<int>
This list contains values from 0 to 45 with an interval of 15. It can be used to bind to SourceMinutes and SourceSeconds.
static
IntervalOf5 IEnumerable<int>
This list contains values from 0 to 55 with an interval of 5. It can be used to bind to SourceMinutes and SourceSeconds.
static
IsClockVisibleProperty DependencyProperty
Identifies the IsClockVisible dependency property.
static
IsDatePickerVisibleProperty DependencyProperty
Identifies the IsDatePickerVisible dependency property.
static
IsDropDownOpenProperty DependencyProperty
Identifies the IsDropDownOpen dependency property.
static
IsReadOnlyProperty DependencyProperty
Identifies the IsReadOnly dependency property.
static
MinutesItemStringFormatProperty DependencyProperty
Identifies the MinutesItemStringFormat dependency property.
static
originalSelectedDateTime DateTime?
PickerVisibilityProperty DependencyProperty
Identifies the PickerVisibility dependency property.
static
SecondsItemStringFormatProperty DependencyProperty
Identifies the SecondsItemStringFormat dependency property.
static
SelectedDateTimeChangedEvent RoutedEvent
static
SelectedDateTimeProperty DependencyProperty
Identifies the SelectedDateTime dependency property.
static
SelectedTimeFormatProperty DependencyProperty
Identifies the SelectedTimeFormat dependency property.
static
SourceHoursProperty DependencyProperty
Identifies the SourceHours dependency property.
static
SourceMinutesProperty DependencyProperty
Identifies the SourceMinutes dependency property.
static
SourceSecondsProperty DependencyProperty
Identifies the SourceSeconds dependency property.
static
textBox DatePickerTextBox

Properties

Name Property Type Summary
Culture CultureInfo
Gets or sets a value indicating the culture to be used in string formatting operations.
HandVisibility TimePartVisibility
Gets or sets a value indicating the visibility of the clock hands in the user interface (UI).
HoursItemStringFormat string
Gets or sets a composite string that specifies how to format the hour items.
IsClockVisible bool
Gets or sets a value indicating whether the clock of this control is visible in the user interface (UI). This is a dependency property.
IsDatePickerVisible bool
Gets or sets a value indicating whether the date can be selected or not. This property is read-only.
IsDropDownOpen bool
Gets or sets a value indicating whether the drop-down for a TimePickerBase box is currently open.
IsMilitaryTime bool
Gets a value indicating whether the System.Globalization.DateTimeFormatInfo.AMDesignator that is specified by the CultureInfo set by the Culture (FrameworkElement.Language if null) has not a value.
IsReadOnly bool
Gets or sets a value indicating whether the contents of the TimePickerBase are not editable.
MinutesItemStringFormat string
Gets or sets a composite string that specifies how to format the minute items.
PickerVisibility TimePartVisibility
Gets or sets a value indicating the visibility of the selectable date-time-parts in the user interface (UI).
SecondsItemStringFormat string
Gets or sets a composite string that specifies how to format the second items.
SelectedDateTime DateTime?
Gets or sets the currently selected date and time.
SelectedTimeFormat TimePickerFormat
Gets or sets the format that is used to display the selected time.
SourceHours IEnumerable<int>
Gets or sets a collection used to generate the content for selecting the hours.
SourceMinutes IEnumerable<int>
Gets or sets a collection used to generate the content for selecting the minutes.
SourceSeconds IEnumerable<int>
Gets or sets a collection used to generate the content for selecting the seconds.
SpecificCultureInfo CultureInfo

Methods

Name Return Value Summary
ApplyCulture() void
ClockSelectedTimeChanged() void
FocusElementAfterIsDropDownOpenChanged() void
This method is invoked when the IsDropDownOpenProperty changes.
GetBinding(DependencyProperty, BindingMode) Binding
GetSelectedTimeFromGUI() TimeSpan?
GetValueForTextBox() string
OnApplyTemplate() void
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
OnPopUpClosed() void
OnPopUpOpened() void
OnSelectedDateTimeChanged(DateTime?, DateTime?) void
RaiseSelectedDateTimeChangedEvent(DateTime?, DateTime?) void
SetDefaultTimeOfDayValues() void
SetSelectedDateTime() void
WriteValueToTextBox() void