Class NumberBox
Represents a control that can be used to display and edit numbers.
public class NumberBox : TextBox, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild
- Inheritance
-
NumberBox
- Implements
- Inherited Members
Constructors
NumberBox()
public NumberBox()
Fields
AcceptsExpressionProperty
Identifies the AcceptsExpression dependency property.
public static readonly DependencyProperty AcceptsExpressionProperty
Field Value
LargeChangeProperty
Identifies the LargeChange dependency property.
public static readonly DependencyProperty LargeChangeProperty
Field Value
MaxDecimalPlacesProperty
Identifies the MaxDecimalPlaces dependency property.
public static readonly DependencyProperty MaxDecimalPlacesProperty
Field Value
MaximumProperty
Identifies the Maximum dependency property.
public static readonly DependencyProperty MaximumProperty
Field Value
MinimumProperty
Identifies the Minimum dependency property.
public static readonly DependencyProperty MinimumProperty
Field Value
NumberFormatterProperty
Identifies the NumberFormatter dependency property.
public static readonly DependencyProperty NumberFormatterProperty
Field Value
SmallChangeProperty
Identifies the SmallChange dependency property.
public static readonly DependencyProperty SmallChangeProperty
Field Value
SpinButtonPlacementModeProperty
Identifies the SpinButtonPlacementMode dependency property.
public static readonly DependencyProperty SpinButtonPlacementModeProperty
Field Value
ValidationModeProperty
Identifies the ValidationMode dependency property.
public static readonly DependencyProperty ValidationModeProperty
Field Value
ValueChangedEvent
Identifies the ValueChanged routed event.
public static readonly RoutedEvent ValueChangedEvent
Field Value
ValueProperty
Identifies the Value dependency property.
public static readonly DependencyProperty ValueProperty
Field Value
Properties
AcceptsExpression
Gets or sets a value indicating whether the control will accept and evaluate a basic formulaic expression entered as input.
public bool AcceptsExpression { get; set; }
Property Value
LargeChange
Gets or sets the value that is added to or subtracted from Value when a large change is made, such as with the PageUP and PageDown keys.
public double LargeChange { get; set; }
Property Value
MaxDecimalPlaces
Gets or sets the number of decimal places to be rounded when converting from Text to Value.
public int MaxDecimalPlaces { get; set; }
Property Value
Maximum
Gets or sets the numerical maximum for Value.
public double Maximum { get; set; }
Property Value
Minimum
Gets or sets the numerical minimum for Value.
public double Minimum { get; set; }
Property Value
NumberFormatter
Gets or sets the number formatter.
public INumberFormatter? NumberFormatter { get; set; }
Property Value
SmallChange
Gets or sets the value that is added to or subtracted from Value when a small change is made, such as with an arrow key or scrolling.
public double SmallChange { get; set; }
Property Value
SpinButtonPlacementMode
Gets or sets a value that indicates the placement of buttons used to increment or decrement the Value property.
public NumberBoxSpinButtonPlacementMode SpinButtonPlacementMode { get; set; }
Property Value
ValidationMode
Gets or sets the input validation behavior to invoke when invalid input is entered.
public NumberBoxValidationMode ValidationMode { get; set; }
Property Value
Value
Gets or sets the numeric value of a NumberBox.
public double? Value { get; set; }
Property Value
Methods
OnClipboardPaste(object, DataObjectPastingEventArgs)
Is called when something is pasted in this NumberBox.
protected virtual void OnClipboardPaste(object sender, DataObjectPastingEventArgs e)
Parameters
sender
objecte
DataObjectPastingEventArgs
OnKeyUp(KeyEventArgs)
Invoked whenever an unhandled System.Windows.Input.Keyboard.KeyUp attached routed event reaches an element derived from this class in its route. Implement this method to add class handling for this event.
protected override void OnKeyUp(KeyEventArgs e)
Parameters
e
KeyEventArgsProvides data about the event.
OnLostFocus(RoutedEventArgs)
Raises the LostFocus event (using the provided arguments).
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgsProvides data about the event.
OnTemplateButtonClick(string?)
Triggered by clicking a button in the control template.
protected override void OnTemplateButtonClick(string? parameter)
Parameters
parameter
string
OnTemplateChanged(ControlTemplate, ControlTemplate)
Is called when the control template changes.
protected override void OnTemplateChanged(ControlTemplate oldTemplate, ControlTemplate newTemplate)
Parameters
oldTemplate
ControlTemplateA ControlTemplate object that specifies the control template that is currently active.
newTemplate
ControlTemplateA ControlTemplate object that specifies a new control template to use.
OnValueChanged(DependencyObject, double?)
protected virtual void OnValueChanged(DependencyObject d, double? oldValue)
Parameters
d
DependencyObjectoldValue
double?
Events
ValueChanged
Occurs after the user triggers evaluation of new input by pressing the Enter key, clicking a spin button, or by changing focus.
public event RoutedEventHandler ValueChanged