Show / Hide Table of Contents

Class UpDownBase<T>

Base class for all controls that provide value manipulation with a Spinner and a text box.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
UpDownBase
UpDownBase<T>
DomainUpDown
NumericUpDown
TimeUpDown
Inherited Members
UpDownBase.SpinnerStyle
UpDownBase.SpinnerStyleProperty
UpDownBase.OnSpinnerStyleChanged(Style, Style)
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.OnGotFocus(RoutedEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.LogicalChildren
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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(Spinner))]
public abstract class UpDownBase<T> : UpDownBase, IControl, IFrameworkElement, IUIElement, IDependencyObject
Type Parameters
Name Description
T

Type of Value property.

Constructors

| Improve this Doc View Source

UpDownBase()

Initializes a new instance of the UpDownBase(of T) class.

Declaration
protected UpDownBase()

Fields

| Improve this Doc View Source

IsEditableProperty

Identifies the IsEditable dependency property.

Declaration
public static readonly DependencyProperty IsEditableProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ValueProperty

Identifies the Value dependency property.

Declaration
public static readonly DependencyProperty ValueProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

IsEditable

Gets or sets a value indicating whether the value can be manually edited by the end-user.

Declaration
public bool IsEditable { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Value

Gets or sets the Value property.

Declaration
public virtual T Value { get; set; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

ApplyValue(String)

Processes user input when the TextBox.TextChanged event occurs.

Declaration
protected virtual void ApplyValue(string text)
Parameters
Type Name Description
System.String text

User input.

| Improve this Doc View Source

FormatValue()

Renders the value property into the textbox text.

Declaration
protected abstract string FormatValue()
Returns
Type Description
System.String

Formatted Value.

| Improve this Doc View Source

GetValue()

GetValue override to return Value property as object type.

Declaration
public sealed override object GetValue()
Returns
Type Description
System.Object

The Value property as object type.

Overrides
UpDownBase.GetValue()
| Improve this Doc View Source

OnApplyTemplate()

Builds the visual tree for the UpDownBase(of T) control when a new template is applied.

Declaration
public override void OnApplyTemplate()
Overrides
Control.OnApplyTemplate()
| Improve this Doc View Source

OnDecrement()

Called by OnSpin when the spin direction is SpinDirection.Increase.

Declaration
protected abstract void OnDecrement()
| Improve this Doc View Source

OnIncrement()

Called by OnSpin when the spin direction is SpinDirection.Increase.

Declaration
protected abstract void OnIncrement()
| Improve this Doc View Source

OnIsEditableChanged(Boolean, Boolean)

Called when IsEditable property value changed.

Declaration
protected virtual void OnIsEditableChanged(bool oldValue, bool newValue)
Parameters
Type Name Description
System.Boolean oldValue

The old value.

System.Boolean newValue

The new value.

| Improve this Doc View Source

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
UIElement.OnKeyDown(KeyEventArgs)
Remarks

Only support up and down arrow keys.

| Improve this Doc View Source

OnMouseWheel(MouseWheelEventArgs)

Provides handling for the MouseWheel event.

Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
Type Name Description
MouseWheelEventArgs e

Mouse wheel event args.

Overrides
UIElement.OnMouseWheel(MouseWheelEventArgs)
| Improve this Doc View Source

OnParseError(UpDownParseErrorEventArgs)

Raises the ParserError event when there is an error in parsing user input.

Declaration
protected virtual void OnParseError(UpDownParseErrorEventArgs e)
Parameters
Type Name Description
UpDownParseErrorEventArgs e

Event args.

| Improve this Doc View Source

OnParsing(UpDownParsingEventArgs<T>)

Raises the Parsing event, to allow easily hooking into the parse logic.

Declaration
protected virtual void OnParsing(UpDownParsingEventArgs<T> e)
Parameters
Type Name Description
UpDownParsingEventArgs<T> e

The UpDownParsingEventArgs<T> instance containing the event data.

| Improve this Doc View Source

OnSpin(SpinEventArgs)

Occurs when the spinner spins.

Declaration
protected virtual void OnSpin(SpinEventArgs e)
Parameters
Type Name Description
SpinEventArgs e

Event args.

| Improve this Doc View Source

OnValueChanged(RoutedPropertyChangedEventArgs<T>)

Raises the ValueChanged event when Value property has changed.

Declaration
protected virtual void OnValueChanged(RoutedPropertyChangedEventArgs<T> e)
Parameters
Type Name Description
RoutedPropertyChangedEventArgs<T> e

Event args.

| Improve this Doc View Source

OnValueChanging(RoutedPropertyChangingEventArgs<T>)

Raises the ValueChanging event when Value property is changing.

Declaration
protected virtual void OnValueChanging(RoutedPropertyChangingEventArgs<T> e)
Parameters
Type Name Description
RoutedPropertyChangingEventArgs<T> e

Event args.

| Improve this Doc View Source

ParseValue(String)

Called by ApplyValue to parse user input.

Declaration
protected abstract T ParseValue(string text)
Parameters
Type Name Description
System.String text

User input.

Returns
Type Description
T

Value parsed from user input.

| Improve this Doc View Source

SelectAllText()

Selects all text.

Declaration
protected virtual void SelectAllText()
| Improve this Doc View Source

SetValue(Object)

SetValue override to set value to Value property.

Declaration
public sealed override void SetValue(object value)
Parameters
Type Name Description
System.Object value

New value.

Overrides
UpDownBase.SetValue(Object)

Events

| Improve this Doc View Source

ParseError

Occurs when there is an error in parsing user input and allows adding parsing logic.

Declaration
public event EventHandler<UpDownParseErrorEventArgs> ParseError
Event Type
Type Description
System.EventHandler<UpDownParseErrorEventArgs>
| Improve this Doc View Source

Parsing

Occurs when a value is being parsed and allows custom parsing.

Declaration
public event EventHandler<UpDownParsingEventArgs<T>> Parsing
Event Type
Type Description
System.EventHandler<UpDownParsingEventArgs<T>>
| Improve this Doc View Source

ValueChanged

Occurs when Value property has changed.

Declaration
public event RoutedPropertyChangedEventHandler<T> ValueChanged
Event Type
Type Description
RoutedPropertyChangedEventHandler<T>
| Improve this Doc View Source

ValueChanging

Occurs when Value property is changing.

Declaration
public event RoutedPropertyChangingEventHandler<T> ValueChanging
Event Type
Type Description
RoutedPropertyChangingEventHandler<T>

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source