Class TimePickerComboBox
Represents a selection control to pick a TimeSpan.
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public sealed class TimePickerComboBox : ComboBox, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IContainItemStorage, IAddChild
Examples
This example illustrates how to use the TimePickerComboBox control to display 30 minute intervals within the range of 24 hours (default):
<SAF:TimePickerComboBox Minimum="00:00:00"
Step="00:30:00" />
This example illustrates how to use the TimePickerComboBox control to display these intervals with a 'Maximum' of 12 hours:
<SAF:TimePickerComboBox Minimum="00:00:00"
Maximum="12:00:00"
Step="00:30:00" />
This example illustrates how to use the TimePickerComboBox control to display these intervals with arrow key editing enabled using 'AllowArrowKeyEditing':
<SAF:TimePickerComboBox Minimum="00:12:00"
Maximum="00:20:00"
Step="01:00:00"
IsEditable="False" />
This example illustrates how to use the TimePickerComboBox control to display these intervals with an altered TimeSpan format:
<SAF:TimePickerComboBox TimeSpanFormat="hh\\:mm"
Minimum="12:00"
Step="00:30"
AllowNull="True" />
Fields
View SourceAllowNullProperty
Identifies the DependencyProperty for AllowNull.
Declaration
public static readonly DependencyProperty AllowNullProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MaximumProperty
Identifies the DependencyProperty for Maximum.
Declaration
public static readonly DependencyProperty MaximumProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
MinimumProperty
Identifies the DependencyProperty for Minimum.
Declaration
public static readonly DependencyProperty MinimumProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
StepProperty
Identifies the DependencyProperty for Step.
Declaration
public static readonly DependencyProperty StepProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TimeSpanFormatProperty
Identifies the DependencyProperty for TimeSpanFormat.
Declaration
public static readonly DependencyProperty TimeSpanFormatProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ValueProperty
Identifies the DependencyProperty for Value.
Declaration
public static readonly DependencyProperty ValueProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceAllowNull
Gets or sets whether null value is allowed.
Declaration
public bool AllowNull { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
If this is true and the user clears the ComboBox Sartorius.SAF.Presentation.Controls.TimePickerComboBox.timeSpanValue will be null.
If this is false and the user clears the ComboBox Sartorius.SAF.Presentation.Controls.TimePickerComboBox.timeSpanValue will be Zero
and the ComboBox will show the appropriate text for Zero.
Maximum
Gets or sets the maximum TimeSpan the user can enter.
Declaration
public DateTime? Maximum { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Remarks
Default is 1 day.
The maximum is excluded.
Minimum
Gets or sets the Minimum TimeSpan the user can enter.
Declaration
public DateTime? Minimum { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
Remarks
Default is Zero.
The minimum is included.
Step
Gets or sets the step the predefined time values should be apart.
Declaration
public TimeSpan Step { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
TimeSpanFormat
Gets or sets the format string for a TimeSpan that is positive and less than one day.
Declaration
public string TimeSpanFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Default is 'hh:mm:ss'
Value
Gets or sets the value.
Declaration
[SuppressMessage("Naming", "CA1721:Property names should not match get methods", Justification = "Property Value can not be changed due to breaking changes. GetValue is method of DependencyObject.")]
public DateTime? Value { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime? | The value. |
Methods
View SourceOnApplyTemplate()
Called when ApplyTemplate() is called.
Declaration
public override void OnApplyTemplate()
Overrides
View SourceOnKeyUp(KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.KeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "The parameter e is never null.")]
protected override void OnKeyUp(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyEventArgs | e | The KeyEventArgs that contains the event data. |
Overrides
View SourceOnLostFocus(RoutedEventArgs)
Raises the LostFocus routed event by using the event data that is provided.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEventArgs | e | A RoutedEventArgs that contains event data. This event data must contain the identifier for the LostFocus event. |
Overrides
View SourceOnPreviewKeyDown(KeyEventArgs)
Invoked when a System.Windows.Input.Keyboard.PreviewKeyDown attached routed event occurs.
Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "The parameter e is never null.")]
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyEventArgs | e | Event data. |
Overrides
View SourceOnSelectionChanged(SelectionChangedEventArgs)
Responds to a ComboBox selection change by raising a SelectionChanged event.
Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "The parameter e is never null.")]
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectionChangedEventArgs | e | Provides data for SelectionChangedEventArgs. |