Class DomainUpDown
Represents a control that enables single value selection from a domain of values through a Spinner and TextBox.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Input.Toolkit.dll
Syntax
[TemplatePart(Name = "Text", Type = typeof(TextBox))]
[TemplatePart(Name = "Spinner", Type = typeof(Spinner))]
[StyleTypedProperty(Property = "SpinnerStyle", StyleTargetType = typeof(ButtonSpinner))]
public class DomainUpDown : UpDownBase<object>, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceDomainUpDown()
Initializes a new instance of the DomainUpDown class.
Declaration
public DomainUpDown()
Fields
| Improve this Doc View SourceCurrentIndexProperty
Identifies the CurrentIndex dependency property.
Declaration
public static readonly DependencyProperty CurrentIndexProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FallbackItemProperty
Identifies the FallbackItem dependency property.
Declaration
public static readonly DependencyProperty FallbackItemProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
GroupDomain
Domain state group.
Declaration
public const string GroupDomain = "DomainStates"
Field Value
Type | Description |
---|---|
System.String |
InvalidInputActionProperty
Identifies the InvalidInputAction dependency property.
Declaration
public static readonly DependencyProperty InvalidInputActionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsCyclicProperty
Identifies the IsCyclic dependency property.
Declaration
public static readonly DependencyProperty IsCyclicProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemTemplateProperty
Identifies the ItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
StateInvalid
InvalidDomain of the Domain state group.
Declaration
public const string StateInvalid = "InvalidDomain"
Field Value
Type | Description |
---|---|
System.String |
StateValid
Valid of the Domain state group.
Declaration
public const string StateValid = "ValidDomain"
Field Value
Type | Description |
---|---|
System.String |
Properties
| Improve this Doc View SourceCurrentIndex
Gets or sets the index of the current selected item.
Declaration
public int CurrentIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
FallbackItem
Gets or sets the item that is used when a user attempts to set a value not included in the domain.
Declaration
public object FallbackItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
FallbackItem will only be used if it is contained within the Items collection.
InvalidInputAction
Gets or sets a value determining the DomainUpDown behavior when a user sets a value not included in the domain.
Declaration
public InvalidInputAction InvalidInputAction { get; set; }
Property Value
Type | Description |
---|---|
InvalidInputAction |
IsCyclic
Gets or sets a value indicating whether the DomainUpDown control will cycle through values when trying to spin the first and last item.
Declaration
public bool IsCyclic { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsEditing
Gets a value indicating whether the control is in EditMode.
Declaration
public bool IsEditing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Items
Gets a collection of items which represent the domain in the DomainUpDown control.
Declaration
public ObservableObjectCollection Items { get; }
Property Value
Type | Description |
---|---|
ObservableObjectCollection | The items. |
Remarks
When ItemsSource is set, will return a copy of the items in ItemsSource. When ItemsSource property is not set (set to null) this collection will return an empty writeable colection.
ItemsSource
Gets or sets a collection of items which represent the domain in the DomainUpDown control.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerable |
ItemTemplate
Gets or sets the DataTemplate used to display an item from the Domain when the item is selected.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
ValueMemberBinding
Gets or sets the Binding object used for object to string conversions.
Declaration
public Binding ValueMemberBinding { get; set; }
Property Value
Type | Description |
---|---|
Binding |
ValueMemberPath
Gets or sets the Binding Path to use for identifying the value.
Declaration
public string ValueMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceApplyValue(String)
Processes user input when the TextBox.TextChanged event occurs.
Declaration
protected override void ApplyValue(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | User input. |
Overrides
FormatValue()
Renders the value property into the textbox text.
Declaration
protected override string FormatValue()
Returns
Type | Description |
---|---|
System.String | Formatted Value. |
Overrides
OnApplyTemplate()
Builds the visual tree for the DomainUpDown control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
OnCreateAutomationPeer()
Returns a DomainUpDownAutomationPeer for use by the Silverlight automation infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
AutomationPeer | The class-specific AutomationPeer subclass to return. |
Overrides
| Improve this Doc View SourceOnCurrentIndexChanged(Int32, Int32)
Processes changes to the CurrentIndex property.
Declaration
protected virtual void OnCurrentIndexChanged(int oldValue, int newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | oldValue | The old value of CurrentIndex. |
System.Int32 | newValue | The new value of CurrentIndex. |
OnDecrement()
Called by OnSpin when the spin direction is SpinDirection.Decrease.
Declaration
protected override void OnDecrement()
Overrides
Remarks
If the IsCyclic property is set to true the DomainUpDown control will not decrement when the selected item is the first item.
OnGotFocus(RoutedEventArgs)
Provides handling for the GotFocus event.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnIncrement()
Called by OnSpin when the spin direction is SpinDirection.Increase.
Declaration
protected override void OnIncrement()
Overrides
Remarks
If the IsCyclic property is set to true the DomainUpDown control will not increment when the selected item is the last item.
OnKeyDown(KeyEventArgs)
Provides handling for the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | Key event args. |
Overrides
OnLostFocus(RoutedEventArgs)
Provides handling for the LostFocus event.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseEnter(MouseEventArgs)
Provides handling for the MouseEnter event.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseLeave(MouseEventArgs)
Provides handling for the MouseLeave event.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonDown(MouseButtonEventArgs)
Provides handling for the MouseLeftButtonDown event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonUp(MouseButtonEventArgs)
Called before the MouseLeftButtonUp event occurs.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnValueChanged(RoutedPropertyChangedEventArgs<Object>)
Raises the ValueChanged event when Value property has changed.
Declaration
protected override void OnValueChanged(RoutedPropertyChangedEventArgs<object> e)
Parameters
Type | Name | Description |
---|---|---|
RoutedPropertyChangedEventArgs<System.Object> | e | Event args. |
Overrides
Remarks
Will set CurrentIndex.
OnValueChanging(RoutedPropertyChangingEventArgs<Object>)
Raises the ValueChanging event when Value property is changing.
Declaration
protected override void OnValueChanging(RoutedPropertyChangingEventArgs<object> e)
Parameters
Type | Name | Description |
---|---|---|
RoutedPropertyChangingEventArgs<System.Object> | e | Event args. |
Overrides
Remarks
Cancels the event when the value is not part of the domain.
ParseValue(String)
Called by ApplyValue to parse user input as a value in the domain.
Declaration
protected override object ParseValue(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | User input. |
Returns
Type | Description |
---|---|
System.Object | Value parsed from user input. |
Overrides
Remarks
An empty string will return the currently selected value.
SelectAllText()
Selects all text.
Declaration
protected override void SelectAllText()