NumberBox
- Assembly:
Fluence.Wpf - Namespace:
Fluence.Wpf.Controls
public class NumberBox : Control
A numeric input control with optional spin buttons and min/max clamping.
Base type: Control (including inherited WPF and .NET members)
Constructors
NumberBox
public NumberBox()
Creates a new NumberBox instance.
Properties
AcceptsExpression
public bool AcceptsExpression { get; set; }
Gets or sets whether the control may parse simple expressions (reserved).
Description
public string Description { get; set; }
Gets or sets helper text displayed below the control.
Header
public object Header { get; set; }
Gets or sets an optional header displayed above the input.
LargeChange
public double LargeChange { get; set; }
Gets or sets the large increment (reserved for keyboard/page navigation).
Maximum
public double Maximum { get; set; }
Gets or sets the maximum allowed value.
Minimum
public double Minimum { get; set; }
Gets or sets the minimum allowed value.
PlaceholderText
public string PlaceholderText { get; set; }
Gets or sets watermark text shown when the text box is empty.
SmallChange
public double SmallChange { get; set; }
Gets or sets the increment used by spin buttons.
SpinButtonPlacementMode
public NumberBoxSpinButtonPlacementMode SpinButtonPlacementMode { get; set; }
Gets or sets where spin buttons are shown.
Text
public string Text { get; set; }
Gets or sets the text representation of the value.
Value
public double Value { get; set; }
Gets or sets the numeric value.
Methods
OnApplyTemplate
public override void OnApplyTemplate()
Documentation inherited from the Control API.
OnCreateAutomationPeer
protected override AutomationPeer OnCreateAutomationPeer()
Documentation inherited from the Control API.
OnDownClick
protected virtual void OnDownClick()
Decrements Value by SmallChange with clamping. A cleared value has nothing to step from, so the call does nothing.
OnGotKeyboardFocus
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Documentation inherited from the Control API.
OnPreviewMouseLeftButtonDown
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Documentation inherited from the Control API.
OnUpClick
protected virtual void OnUpClick()
Increments Value by SmallChange with clamping. A cleared value has nothing to step from, so the call does nothing.
OnValueChanged
protected virtual void OnValueChanged(double oldValue, double newValue)
Raises the ValueChanged event.
Parameter oldValue: The previous value.
Parameter newValue: The new value.
TryParseText
public bool TryParseText()
Updates Value from Text if parsing succeeds, and clears Value to NaN when the field is empty.
Returns: true if a number was parsed and applied; otherwise false.
Events
ValueChanged
public event EventHandler<NumberBoxValueChangedEventArgs>? ValueChanged
Occurs when Value changes after coercion.
Dependency property identifiers
Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.
AcceptsExpressionProperty
public static readonly DependencyProperty AcceptsExpressionProperty
Identifies the AcceptsExpression dependency property.
DescriptionProperty
public static readonly DependencyProperty DescriptionProperty
Identifies the Description dependency property.
HeaderProperty
public static readonly DependencyProperty HeaderProperty
Identifies the Header dependency property.
LargeChangeProperty
public static readonly DependencyProperty LargeChangeProperty
Identifies the LargeChange dependency property.
MaximumProperty
public static readonly DependencyProperty MaximumProperty
Identifies the Maximum dependency property.
MinimumProperty
public static readonly DependencyProperty MinimumProperty
Identifies the Minimum dependency property.
PlaceholderTextProperty
public static readonly DependencyProperty PlaceholderTextProperty
Identifies the PlaceholderText dependency property.
SmallChangeProperty
public static readonly DependencyProperty SmallChangeProperty
Identifies the SmallChange dependency property.
SpinButtonPlacementModeProperty
public static readonly DependencyProperty SpinButtonPlacementModeProperty
Identifies the SpinButtonPlacementMode dependency property.
TextProperty
public static readonly DependencyProperty TextProperty
Identifies the Text dependency property.
ValueProperty
public static readonly DependencyProperty ValueProperty
Identifies the Value dependency property.