Class RealNumberTextBox
- Namespace
- CarinaStudio.Controls
- Assembly
- CarinaStudio.AppBase.Avalonia.dll
Avalonia.Controls.TextBox to let user input a real number.
public class RealNumberTextBox : ValueTextBox<double>, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, IInputElement, IDataTemplateHost, INamed, ISetterValue
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTemplatedControlTextBoxRealNumberTextBox
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentIStyleableIInputElementIDataTemplateHostINamedISetterValue
- Inherited Members
-
TextBox.AcceptsReturnPropertyTextBox.AcceptsTabPropertyTextBox.CaretIndexPropertyTextBox.IsReadOnlyPropertyTextBox.PasswordCharPropertyTextBox.SelectionBrushPropertyTextBox.SelectionForegroundBrushPropertyTextBox.CaretBrushPropertyTextBox.SelectionStartPropertyTextBox.SelectionEndPropertyTextBox.MaxLengthPropertyTextBox.MaxLinesPropertyTextBox.TextPropertyTextBox.TextAlignmentPropertyTextBox.HorizontalContentAlignmentPropertyTextBox.VerticalContentAlignmentPropertyTextBox.TextWrappingPropertyTextBox.LineHeightPropertyTextBox.LetterSpacingPropertyTextBox.WatermarkPropertyTextBox.UseFloatingWatermarkPropertyTextBox.NewLinePropertyTextBox.InnerLeftContentPropertyTextBox.InnerRightContentPropertyTextBox.RevealPasswordPropertyTextBox.CanCutPropertyTextBox.CanCopyPropertyTextBox.CanPastePropertyTextBox.IsUndoEnabledPropertyTextBox.UndoLimitPropertyTextBox.CanUndoPropertyTextBox.CanRedoPropertyTextBox.CopyingToClipboardEventTextBox.CuttingToClipboardEventTextBox.PastingFromClipboardEventTextBox.TextChangedEventTextBox.TextChangingEventTextBox.ClearSelection()TextBox.OnApplyTemplate(TemplateAppliedEventArgs)TextBox.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)TextBox.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)TextBox.OnGotFocus(GotFocusEventArgs)TextBox.Cut()TextBox.Copy()TextBox.Paste()TextBox.OnPointerPressed(PointerPressedEventArgs)TextBox.OnPointerMoved(PointerEventArgs)TextBox.OnPointerReleased(PointerReleasedEventArgs)TextBox.OnCreateAutomationPeer()TextBox.Clear()TextBox.SelectAll()TextBox.Undo()TextBox.Redo()TextBox.MeasureOverride(Size)TextBox.CutGestureTextBox.CopyGestureTextBox.PasteGestureTextBox.AcceptsReturnTextBox.AcceptsTabTextBox.CaretIndexTextBox.IsReadOnlyTextBox.PasswordCharTextBox.SelectionBrushTextBox.SelectionForegroundBrushTextBox.CaretBrushTextBox.SelectionStartTextBox.SelectionEndTextBox.MaxLengthTextBox.MaxLinesTextBox.LetterSpacingTextBox.LineHeightTextBox.TextTextBox.SelectedTextTextBox.HorizontalContentAlignmentTextBox.VerticalContentAlignmentTextBox.TextAlignmentTextBox.WatermarkTextBox.UseFloatingWatermarkTextBox.InnerLeftContentTextBox.InnerRightContentTextBox.RevealPasswordTextBox.TextWrappingTextBox.NewLineTextBox.CanCutTextBox.CanCopyTextBox.CanPasteTextBox.IsUndoEnabledTextBox.UndoLimitTextBox.CanUndoTextBox.CanRedoTextBox.CopyingToClipboardTextBox.CuttingToClipboardTextBox.PastingFromClipboardTextBox.TextChangedTextBox.TextChangingTemplatedControl.BackgroundPropertyTemplatedControl.BorderBrushPropertyTemplatedControl.BorderThicknessPropertyTemplatedControl.CornerRadiusPropertyTemplatedControl.FontFamilyPropertyTemplatedControl.FontSizePropertyTemplatedControl.FontStylePropertyTemplatedControl.FontWeightPropertyTemplatedControl.FontStretchPropertyTemplatedControl.ForegroundPropertyTemplatedControl.PaddingPropertyTemplatedControl.TemplatePropertyTemplatedControl.IsTemplateFocusTargetPropertyTemplatedControl.TemplateAppliedEventTemplatedControl.GetIsTemplateFocusTarget(Control)TemplatedControl.ApplyTemplate()TemplatedControl.GetTemplateFocusTarget()TemplatedControl.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)TemplatedControl.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)TemplatedControl.OnTemplateChanged(AvaloniaPropertyChangedEventArgs)TemplatedControl.BackgroundTemplatedControl.BorderBrushTemplatedControl.BorderThicknessTemplatedControl.CornerRadiusTemplatedControl.FontFamilyTemplatedControl.FontSizeTemplatedControl.FontStyleTemplatedControl.FontWeightTemplatedControl.FontStretchTemplatedControl.ForegroundTemplatedControl.PaddingTemplatedControl.TemplateTemplatedControl.TemplateAppliedControl.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.ContextRequestedEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.OnLoaded(RoutedEventArgs)Control.OnUnloaded(RoutedEventArgs)Control.OnSizeChanged(SizeChangedEventArgs)Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnKeyUp(KeyEventArgs)Control.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.ContextRequestedControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.LostFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.TappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.Focus(NavigationMethod, KeyModifiers)InputElement.OnPointerEntered(PointerEventArgs)InputElement.OnPointerExited(PointerEventArgs)InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)InputElement.OnPointerWheelChanged(PointerWheelEventArgs)InputElement.UpdateIsEffectivelyEnabled()InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.IsEnabledCoreInputElement.GestureRecognizersInputElement.GotFocusInputElement.LostFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.TappedInputElement.HoldingInputElement.DoubleTappedInteractive.RaiseEvent(RoutedEventArgs)Interactive.BuildEventRoute(RoutedEvent)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])Layoutable.AffectsArrange<T>(params AvaloniaProperty[])Layoutable.MeasureCore(Size)Layoutable.ArrangeCore(Rect)Layoutable.ArrangeOverride(Size)Layoutable.OnMeasureInvalidated()Layoutable.OnVisualParentChanged(Visual, Visual)Layoutable.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.GetFlowDirection(Visual)Visual.SetFlowDirection(Visual, FlowDirection)Visual.InvalidateVisual()Visual.Render(DrawingContext)Visual.AffectsRender<T>(params AvaloniaProperty[])Visual.InvalidateMirrorTransform()Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.VisualChildrenVisual.VisualRootVisual.BypassFlowDirectionPoliciesVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.InitializeIfNeeded()StyledElement.OnDataContextBeginUpdate()StyledElement.OnDataContextEndUpdate()StyledElement.OnInitialized()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.LogicalChildrenStyledElement.PseudoClassesStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)Animatable.TransitionsAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)AvaloniaObject.InheritanceParentAvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.PropertyChanged
- Extension Methods
Constructors
RealNumberTextBox()
Initialize new RealNumberTextBox instance.
public RealNumberTextBox()
Fields
IsNaNAllowedProperty
Property of IsNaNAllowed.
public static readonly StyledProperty<bool> IsNaNAllowedProperty
Field Value
- StyledProperty<bool>
MaximumProperty
Property of Maximum.
public static readonly StyledProperty<double> MaximumProperty
Field Value
- StyledProperty<double>
MinimumProperty
Property of Minimum.
public static readonly StyledProperty<double> MinimumProperty
Field Value
- StyledProperty<double>
ValueProperty
Property of Value.
public static readonly DirectProperty<RealNumberTextBox, double?> ValueProperty
Field Value
- DirectProperty<RealNumberTextBox, double?>
Properties
IsNaNAllowed
Get or set whether NaN is allowed or not.
public bool IsNaNAllowed { get; set; }
Property Value
Maximum
Get or set maximum value.
public double Maximum { get; set; }
Property Value
Minimum
Get or set minimum value.
public double Minimum { get; set; }
Property Value
Value
Get or set value.
public override double? Value { get; set; }
Property Value
Methods
OnKeyDown(KeyEventArgs)
Called before the Avalonia.Input.InputElement.KeyDown event occurs.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
eKeyEventArgsThe event args.
OnPastingFromClipboard(string?)
Called when pasting text from clipboard
protected override void OnPastingFromClipboard(string? text)
Parameters
textstringThe text from clipboard.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
changeAvaloniaPropertyChangedEventArgsThe property change details.
OnTextInput(TextInputEventArgs)
Called before the Avalonia.Input.InputElement.TextInput event occurs.
protected override void OnTextInput(TextInputEventArgs e)
Parameters
eTextInputEventArgsThe event args.
RaiseValueChanged(double?, double?)
Raise property changed event of Value.
protected override void RaiseValueChanged(double? oldValue, double? newValue)
Parameters
TryConvertToValue(string, out double?)
Try converting text to value.
protected override bool TryConvertToValue(string text, out double? value)
Parameters
Returns
- bool
True if conversion succeeded.