Skip to main content Link Search Menu Expand Document (external link)

NumberBox

Namespace: FluentAvalonia.UI.Controls

Represents a control that can be used to display and edit numbers.

C#

public class NumberBox : TemplatedControl


Xaml

<ui:NumberBox />


Required Template Parts

Name Control Type
DownSpinButton RepeatButton
PopupDownSpinButton RepeatButton
UpSpinButton RepeatButton
PopupUpSpinButton RepeatButton
InputBox TextBox
UpDownPopup Popup


Pseudoclasses

:spinvisible, :spinpopup, :spincollapsed, :updisabled, :downdisabled, :header, :disabled, :focus, :focus-visible, :focus-within, :pointerover



Examples and Usage Notes

None yet.


API

Note: Inherited members are not shown


Properties

AcceptsExpression Toggles whether the control will accept and evaluate a basic formulaic expression entered as input.
AcceptsExpressionProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.AcceptsExpression` property
Description Gets or sets content that is shown below the control. The content should provide guidance about the input expected by the control.
DescriptionProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.Description` property
Header Gets or sets the content for the control's header.
HeaderProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.Header` property
HeaderTemplate Gets or sets the DataTemplate used to display the content of the control's header.
HeaderTemplateProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.HeaderTemplate` property
IsWrapEnabled Toggles whether line breaking occurs if a line of text extends beyond the available width of the control.
IsWrapEnabledProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.IsWrapEnabled` property
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.
LargeChangeProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.LargeChange` property
Maximum Gets or sets the numerical maximum for Value.
MaximumProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.Maximum` property
Minimum Gets or sets the numerical minimum for Value.
MinimumProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.Minimum` property
NumberFormatter A function for customizing the format of the NumberBox Value Text.
PlaceholderText Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
PlaceholderTextProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.PlaceholderText` property
SelectionFlyout Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown. NOTE: This property is not implemented
SelectionFlyoutProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.SelectionFlyout` property
SelectionHighlightColor Gets or sets the brush used to highlight the selected text.
SelectionHighlightColorProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.SelectionHighlightColor` property
SimpleNumberFormat Use this for simple number formatting using normal .net formatting. Resulting string must still be numeric in value, no special characters, as they are not removed when attempting to convert text to value
SimpleNumberFormatProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.SimpleNumberFormat` property
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.
SmallChangeProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.SmallChange` property
SpinButtonPlacementMode Gets or sets a value that indicates the placement of buttons used to increment or decrement the Value property.
SpinButtonPlacementModeProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.SpinButtonPlacementMode` property
Text Gets or sets the string type representation of the Value property.
TextAlignment Gets or sets the TextAlignment of the text in the NumberBox
TextAlignmentProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.TextAlignment` property
TextProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.Text` property
TextReadingOrder Gets or sets a value that indicates how the reading order is determined for the NumberBox. NOTE This property is not implemented
TextReadingOrderProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.TextReadingOrder` property
ValidationMode Gets or sets the input validation behavior to invoke when invalid input is entered.
ValidationModeProperty Defines the `FluentAvalonia.UI.Controls.NumberBoxValidationMode` property
Value Gets or sets the numeric value of a NumberBox.
ValueProperty Defines the `FluentAvalonia.UI.Controls.NumberBox.Value` property


Events

ValueChanged Occurs after the user triggers evaluation of new input by pressing the Enter key, clicking a spin button, or by changing focus.


Methods


NumberBoxSpinButtonPlacementMode

Hidden The spin buttons are not displayed.
Compact The spin buttons have two visual states, depending on focus. By default, the spin buttons are displayed in a compact, vertical orientation. When the Numberbox gets focus, the spin buttons expand.
Inline The spin buttons are displayed in an expanded, horizontal orientation.


NumberBoxValidationMode

InvalidInputOverwritten Invalid input is replaced by NumberBox.PlaceholderText text.
Disabled Input validation is disabled


NumberBoxValueChangedEventArgs

OldValue Contains the old Value being replaced in a NumberBox.
NewValue Contains the new Value to be set for a NumberBox.