Class NumberBox
Represents a control that can be used to display and edit numbers.
[TemplatePart(Name = "PART_ClearButton", Type = typeof(Button))]
[TemplatePart(Name = "PART_InlineIncrementButton", Type = typeof(RepeatButton))]
[TemplatePart(Name = "PART_InlineDecrementButton", Type = typeof(RepeatButton))]
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
OnApplyTemplate()
Is called when a control template is applied.
public override void OnApplyTemplate()
OnClipboardPaste(object, DataObjectPastingEventArgs)
Is called when something is pasted in this NumberBox.
protected virtual void OnClipboardPaste(object sender, DataObjectPastingEventArgs e)
Parameters
sender
objecte
DataObjectPastingEventArgs
OnLostFocus(RoutedEventArgs)
Raises the LostFocus event (using the provided arguments).
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgsProvides data about the event.
OnPreviewKeyDown(KeyEventArgs)
Called when the KeyDown occurs.
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgsThe event data.
OnPreviewKeyUp(KeyEventArgs)
Invoked when an unhandled System.Windows.Input.Keyboard.PreviewKeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected override void OnPreviewKeyUp(KeyEventArgs e)
Parameters
e
KeyEventArgsThe KeyEventArgs that contains the event data.
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 NumberBoxValueChangedEvent ValueChanged