Table of Contents

Class NumberBox

Namespace
Wpf.Ui.Controls
Assembly
Wpf.Ui.dll

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

DependencyProperty

LargeChangeProperty

Identifies the LargeChange dependency property.

public static readonly DependencyProperty LargeChangeProperty

Field Value

DependencyProperty

MaxDecimalPlacesProperty

Identifies the MaxDecimalPlaces dependency property.

public static readonly DependencyProperty MaxDecimalPlacesProperty

Field Value

DependencyProperty

MaximumProperty

Identifies the Maximum dependency property.

public static readonly DependencyProperty MaximumProperty

Field Value

DependencyProperty

MinimumProperty

Identifies the Minimum dependency property.

public static readonly DependencyProperty MinimumProperty

Field Value

DependencyProperty

NumberFormatterProperty

Identifies the NumberFormatter dependency property.

public static readonly DependencyProperty NumberFormatterProperty

Field Value

DependencyProperty

SmallChangeProperty

Identifies the SmallChange dependency property.

public static readonly DependencyProperty SmallChangeProperty

Field Value

DependencyProperty

SpinButtonPlacementModeProperty

Identifies the SpinButtonPlacementMode dependency property.

public static readonly DependencyProperty SpinButtonPlacementModeProperty

Field Value

DependencyProperty

ValidationModeProperty

Identifies the ValidationMode dependency property.

public static readonly DependencyProperty ValidationModeProperty

Field Value

DependencyProperty

ValueChangedEvent

Identifies the ValueChanged routed event.

public static readonly RoutedEvent ValueChangedEvent

Field Value

RoutedEvent

ValueProperty

Identifies the Value dependency property.

public static readonly DependencyProperty ValueProperty

Field Value

DependencyProperty

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

bool

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

double

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

int

Maximum

Gets or sets the numerical maximum for Value.

public double Maximum { get; set; }

Property Value

double

Minimum

Gets or sets the numerical minimum for Value.

public double Minimum { get; set; }

Property Value

double

NumberFormatter

Gets or sets the number formatter.

public INumberFormatter? NumberFormatter { get; set; }

Property Value

INumberFormatter

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

double

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

NumberBoxSpinButtonPlacementMode

ValidationMode

Gets or sets the input validation behavior to invoke when invalid input is entered.

public NumberBoxValidationMode ValidationMode { get; set; }

Property Value

NumberBoxValidationMode

Value

Gets or sets the numeric value of a NumberBox.

public double? Value { get; set; }

Property Value

double?

Methods

OnClipboardPaste(object, DataObjectPastingEventArgs)

Is called when something is pasted in this NumberBox.

protected virtual void OnClipboardPaste(object sender, DataObjectPastingEventArgs e)

Parameters

sender object
e 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 KeyEventArgs

Provides data about the event.

OnLostFocus(RoutedEventArgs)

Raises the LostFocus event (using the provided arguments).

protected override void OnLostFocus(RoutedEventArgs e)

Parameters

e RoutedEventArgs

Provides 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 ControlTemplate

A ControlTemplate object that specifies the control template that is currently active.

newTemplate ControlTemplate

A ControlTemplate object that specifies a new control template to use.

OnValueChanged(DependencyObject, double?)

Is called when Value in this NumberBox changes.

protected virtual void OnValueChanged(DependencyObject d, double? oldValue)

Parameters

d DependencyObject
oldValue 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

Event Type

RoutedEventHandler