NumericSpinner Class

Control to implement the ability to increase and decrease numeric values using a 'NumericUpDown' style control.

Definition

Namespace: Common.Wpf.Controls
Assembly: Common.Wpf.Controls (in Common.Wpf.Controls.dll) Version: 2.0.7
C#
public class NumericSpinner : TextBox
Inheritance
Object    DispatcherObject    DependencyObject    Visual    UIElement    FrameworkElement    Control    TextBoxBase    TextBox    NumericSpinner

Remarks

1. Add a namespace attribute to the root element of the markup file it is to be used in:
XAML
xmlns:cc="clr-namespace:Common.Wpf.Controls;assembly=Common.Wpf.Controls"
2. Define the control specifying the minimum and maximum values:
XAML
<cc:NumericSpinner MinValue="0" MaxValue="140"... />

Constructors

NumericSpinnerInitializes a new instance of the NumericSpinner class.

Properties

DecimalsGets or sets the number of decimals to display. The default is zero.
IsErrorShownGets or sets whether error messages are shown to the user below the control. The default is .
MaxValueGets or sets the maximum value allowed. The default is decimal maximum.
MinValueGets or sets the minimum value allowed. The default is decimal minimum.
StepGets or sets the increase/decrease value whenever a button is used. The default is one.

Methods

OnApplyTemplateWhen overridden in a derived class, this is invoked whenever application code or internal processes call ApplyTemplate().
(Overrides TextBoxBaseOnApplyTemplate)
OnTextChangedIs called when content in this editing control changes.
(Overrides TextBoxBaseOnTextChanged(TextChangedEventArgs))

Events

PropertyChangedOccurs when a property has changed.

Fields

DecimalsPropertyIdentifies the Decimals dependency property.
IsErrorShownPropertyIdentifies the IsErrorShown dependency property.
MaxValuePropertyIdentifies the MaxValue dependency property.
MinValuePropertyIdentifies the MinValue dependency property.
StepPropertyIdentifies the Step dependency property.

See Also