TimePickerBase Class

Summary

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["DateTimePicker"]-->Type click Derived0 "/api/MahApps.Metro.Controls/DateTimePicker" Derived1["TimePicker"]-->Type click Derived1 "/api/MahApps.Metro.Controls/TimePicker"

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 Constant Value Summary
CultureProperty
Identifies the Culture dependency property.
static
HandVisibilityProperty
Identifies the HandVisibility dependency property.
static
hourInput
HoursItemStringFormatProperty
Identifies the HoursItemStringFormat dependency property.
static
IntervalOf10
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
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
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
Identifies the IsClockVisible dependency property.
static
IsDatePickerVisibleProperty
Identifies the IsDatePickerVisible dependency property.
static
IsDropDownOpenProperty
Identifies the IsDropDownOpen dependency property.
static
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
static
MinutesItemStringFormatProperty
Identifies the MinutesItemStringFormat dependency property.
static
originalSelectedDateTime
PickerVisibilityProperty
Identifies the PickerVisibility dependency property.
static
SecondsItemStringFormatProperty
Identifies the SecondsItemStringFormat dependency property.
static
SelectedDateTimeChangedEvent
static
SelectedDateTimeProperty
Identifies the SelectedDateTime dependency property.
static
SelectedTimeFormatProperty
Identifies the SelectedTimeFormat dependency property.
static
SourceHoursProperty
Identifies the SourceHours dependency property.
static
SourceMinutesProperty
Identifies the SourceMinutes dependency property.
static
SourceSecondsProperty
Identifies the SourceSeconds dependency property.
static
textBox

Properties

Name Value 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 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