NumberBox ClassDW.WPFToolkit Documentation
Displays a TextBox to accept numeric values only, so the text can be bound to a numeric property direclty without converting.
Inheritance Hierarchy

SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            System.Windows.ControlsControl
              DW.WPFToolkit.ControlsNumberBox

Namespace: DW.WPFToolkit.Controls
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public class NumberBox : Control

The NumberBox type exposes the following members.

Constructors

  NameDescription
Public methodNumberBox
Initializes a new instance of the NumberBox class.
Top
Methods

  NameDescription
Public methodOnApplyTemplate
The template gets added to the control.
(Overrides FrameworkElementOnApplyTemplate.)
Top
Fields

  NameDescription
Public fieldStatic memberAcceptUpDownOnNullProperty
Identifies the AcceptUpDownOnNull dependency property.
Public fieldStatic memberCanResetProperty
Identifies the CanReset dependency property.
Public fieldStatic memberCanStepDownProperty
Identifies the CanStepDown dependency property.
Public fieldStatic memberCanStepUpProperty
Identifies the CanStepUp dependency property.
Public fieldStatic memberCheckBoxBehaviorProperty
Identifies the CheckBoxBehavior dependency property.
Public fieldStatic memberCheckBoxPositionProperty
Identifies the CheckBoxPosition dependency property.
Public fieldStatic memberDefaultNumberProperty
Identifies the DefaultNumber dependency property.
Public fieldStatic memberHasCheckBoxProperty
Identifies the HasCheckBox dependency property.
Public fieldStatic memberHasResetButtonProperty
Identifies the HasResetButton dependency property.
Public fieldStatic memberInputCultureProperty
Identifies the InputCulture dependency property.
Public fieldStatic memberIsCheckedProperty
Identifies the IsChecked dependency property.
Public fieldStatic memberIsReadOnlyProperty
Identifies the IsReadOnly dependency property.
Public fieldStatic memberLostFocusBehaviorProperty
Identifies the LostFocusBehavior dependency property.
Public fieldStatic memberMaximumProperty
Identifies the Maximum dependency property.
Public fieldStatic memberMinimumProperty
Identifies the Minimum dependency property.
Public fieldStatic memberNumberChangedEvent
Identifies the NumberChanged routed event.
Public fieldStatic memberNumberProperty
Identifies the Number dependency property.
Public fieldStatic memberNumberSelectionBehaviorProperty
Identifies the NumberSelectionBehavior dependency property.
Public fieldStatic memberNumberTypeProperty
Identifies the NumberType dependency property.
Public fieldStatic memberPredefinesCultureProperty
Identifies the PredefinesCulture dependency property.
Public fieldStatic memberResetButtonPositionProperty
Identifies the ResetButtonPosition dependency property.
Public fieldStatic memberStepProperty
Identifies the Step dependency property.
Public fieldStatic memberUnitPositionProperty
Identifies the UnitPosition dependency property.
Public fieldStatic memberUnitProperty
Identifies the Unit dependency property.
Public fieldStatic memberUpDownBehaviorProperty
Identifies the Step dependency property.
Public fieldStatic memberUpDownButtonsPositionProperty
Identifies the UpDownButtonsPosition dependency property.
Top
Properties

  NameDescription
Public propertyAcceptUpDownOnNull
Gets or sets a value which indicates if increment and decrement is possible even if the value is null. Minimum or maximum then will be placed in.
Public propertyCanReset
Gets or sets a value which indicates if the reset button can be clicked.
Public propertyCanStepDown
Gets or sets a value which indicates if the current number can step down.
Public propertyCanStepUp
Gets or sets a value which indicates if the current number can step up.
Public propertyCheckBoxBehavior
Gets or sets the behavior of the checkbox.
Public propertyCheckBoxPosition
Gets or sets the position of the checkbox.
Public propertyDefaultNumber
Gets or sets the default value to place in when the "ResetButton" (See HasResetButton) is clicked.
Public propertyHasCheckBox
Gets or sets the value which indicates if a checkbox is shown in the NumberBox.
Public propertyHasResetButton
Gets or sets a value which indicates if the NumberBox has a cancel 'X' button.
Public propertyInputCulture
Gets or sets the culture to be used to parse the user input.
Public propertyIsChecked
Gets or sets the value which indicates of the checkbox is checked.
Public propertyIsReadOnly
Gets or sets a value if the textbox is shown read only.
Public propertyLostFocusBehavior
Gets or sets the bavior to be applied to the number and/or text when the NumberBox lost its focus.
Public propertyMaximum
Gets or sets the maximum value to be written into the NumberBox.
Public propertyMinimum
Gets or sets the minimum value to be written into the NumberBox.
Public propertyNumber
Gets or sets the number value. It can be any of the NumberType.
Public propertyNumberSelectionBehavior
Gets or sets a value that defines when the number should be selected automatically.
Public propertyNumberType
Gets or sets the type of number to be supported in the NumberBox.
Public propertyPredefinesCulture
Gets or sets the culture to be used to parse the value defined in the xaml file like Minimum, Maximum and DefaultNumber.
Public propertyResetButtonPosition
Gets or sets the position of the reset button within the NumberBox.
Public propertyStep
Gets or sets the step width to be used when increment the value by the buttons or arrow keys.
Public propertyUnit
Gets or sets the unit.
Public propertyUnitPosition
Gets or sets the position of the unit within the NumberBox.
Public propertyUpDownBehavior
Gets or sets the possibilies how the values can be incremented or decremented.
Public propertyUpDownButtonsPosition
Gets or sets the position of the up/down buttons.
Top
Events

  NameDescription
Public eventNumberChanged
Occurs when the Numvber value has been changed.
Top
Examples

XAML
<!-- Many properties are set only for display the possibilities -->
<Toolkit:NumberBox NumberType="Double"

                   Number="{Binding MyDoubleValue}"
                   Minimum="-12.5"
                   Maximum="55.5"
                   DefaultNumber="5"

                   ShowCurrency="True"
                   Currency="€"
                   CurrencyPosition="Right"

                   HasCheckBox="True"
                   CheckBoxBehavior="EnableIfChecked"
                   IsChecked="{Binding MyDoubleValueIsChecked}"
                   CheckBoxPosition="Left"

                   UpDownBehavior="ArrowsAndButtons"
                   Step="0.5"
                   UpDownButtonsPosition="Right"

                   NumberSelectionBehavior="OnFocusAndUpDown"

                   LostFocusBehavior="{Toolkit:LostFocusBehavior PlaceDefaultNumber, TrimLeadingZero=True, FormatText={}{0:D2}}"

                   PredefinesCulture="en-US" />
See Also

Reference