Class NumericTextBoxBehavior
TextBox支持数值输入,鼠标滚动 拖动改变值等效果的行为
public class NumericTextBoxBehavior : Behavior<TextBox>, IAnimatable, IAttachedObject
- Inheritance
-
NumericTextBoxBehavior
- Implements
- Inherited Members
- Extension Methods
Fields
AllowMouseDragProperty
AllowMouseDrag Dependency Property
public static readonly DependencyProperty AllowMouseDragProperty
Field Value
IsEnabledProperty
This property allows the behavior to be used as a traditional attached property behavior.
public static DependencyProperty IsEnabledProperty
Field Value
MaximumProperty
Backing storage for maximum
public static readonly DependencyProperty MaximumProperty
Field Value
MinimumProperty
Backing storage for minimum
public static readonly DependencyProperty MinimumProperty
Field Value
Properties
AllowMouseDrag
Gets or sets the AllowMouseDrag property. When set to "True", the NumericTextBoxBehavior will allow Mouse "drags" to adjust the value - similar to the Blend text boxes.
public bool AllowMouseDrag { get; set; }
Property Value
Maximum
Maximum value
public long Maximum { get; set; }
Property Value
Minimum
Minimum value
public long Minimum { get; set; }
Property Value
Methods
GetIsEnabled(TextBox)
Returns whether NumericTextBoxBehavior is enabled via attached property
public static bool GetIsEnabled(TextBox textBox)
Parameters
textBox
TextBox
Returns
- bool
True/FalseB
OnAttached()
This attaches the property handlers - PreviewKeyDown, Clipboard support and our adorner.
protected override void OnAttached()
OnDetaching()
This removes all our handlers.
protected override void OnDetaching()
SetIsEnabled(TextBox, bool)
Adds NumericTextBoxBehavior to TextBox
public static void SetIsEnabled(TextBox textBox, bool value)