Table of Contents

Class NumericTextBoxBehavior

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll

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

DependencyProperty

IsEnabledProperty

This property allows the behavior to be used as a traditional attached property behavior.

public static DependencyProperty IsEnabledProperty

Field Value

DependencyProperty

MaximumProperty

Backing storage for maximum

public static readonly DependencyProperty MaximumProperty

Field Value

DependencyProperty

MinimumProperty

Backing storage for minimum

public static readonly DependencyProperty MinimumProperty

Field Value

DependencyProperty

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

bool

Maximum

Maximum value

public long Maximum { get; set; }

Property Value

long

Minimum

Minimum value

public long Minimum { get; set; }

Property Value

long

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)

Parameters

textBox TextBox

TextBox to apply

value bool

True/False