Skip to content
Dirkster99 edited this page Oct 20, 2022 · 16 revisions

The control library in this project implements a number of .Net data type specific controls:

Each of these controls implements the properties below (where T is the data type listed above):

IsMouseDragEnabled

bool IsMouseDragEnabled { get; set; }

Gets/sets whether the mouse can be used to increment/decrement the displayed value be dragging the mouse over the control.

See also #2.

CanMouseDrag

Gets/sets whether small/large step sizes can be incremented/decremented both with vertical/horizontal mouse drag moves or, whether only horizontal or only vertical mouse drag moves can incremented/decremented only in small or only in large values.

Possible Values are:

  • VerticalOnly

    • A value can be incremented/decremented in small steps using vertical mouse drag moves only.
  • HorizontalOnly

    • A value can be incremented/decremented in large steps using horizontal mouse drag moves only.
  • VerticalHorizontal

    • A value can be incremented/decremented in small steps or large steps using vertical or horizontal mouse drag moves at the same time.

See also #7.

Command and CommandParameter Binding

ICommand Command { get; set; }
object CommandParameter  { get; set; }

Gets/Sets a command that can be invoked when a up/down button is clicked.

IsIncDecButtonsVisible

bool IsIncDecButtonsVisible { get; set; }

Gets/sets whether the Increment or Decrement button is currently visible or not.

MouseWheelAccelaratorKey

ModifierKeys MouseWheelAccelaratorKey { get; set; }

Gets/sets the accelerator key of type ModifierKeys that can be pressed on the keyboard during mouse wheel scrolling over the control. Pressing the mousewheel accelerator key results in using LargeStepSize property as base of increment/decrement steps, while otherwise the StepSize property is applied as base of increments/decrement steps.

LargeStepSize

<T> LargeStepSize { get; set; }

Implements an abstract place holder for a dependency property that should be implemented in a deriving class. The place holder is necessary here because the default value (usually greater than 1) cannot be formulated with {T}. Gets or sets a large step size (actual distance) of increment or decrement step. This value should be greater than 1 but at least 1.

StepSize

<T> StepSize { get; set; }

Gets or sets the step size (actual distance) of increment or decrement step. This value should at least be 1 or greater and is used whenever the control performs a small increment or decrement of the current value.

SelectAllTextOnFocus

bool SelectAllTextOnFocus { get; set; }

Gets/sets a dependency property to determine whether all text in the textbox should be selected on textbox focus or not.

IsReadOnly

bool IsReadOnly { get; set; }

Determines whether the textbox portion of the control is editable (requires additional check of bounds) or not.

NumberStyle

NumberStyles NumberStyle { get; set; }

Gets/sets the allowed style of a number entered and displayed in the textbox.

FormatString

string FormatString { get; set; }

Gets/sets a .Net FormatString that is applied to the textbox text portion of the up down control.

IsDisplayLengthFixed

bool IsDisplayLengthFixed { get; set; }

Gets/sets whether the textbox portion of the numeric up down control can go grow and shrink with its input or whether it should stay with a fixed width.

DisplayLength

byte DisplayLength { get; set; }

Gets/sets the number of characters to display in the textbox portion of the AbstractBaseUpDown control.

MaxValue

<T> MaxValue { get; set; }

Get/set dependency property to define the maximum legal value.

MinValue

<T> MinValue { get; set; }

Get/set dependency property to define the minimum legal value.

Value

<T> Value { get; set; }

Gets or sets the value assigned to the control.

WaterMark

Gets/sets the watermark style of a number entered and displayed in the textbox.

string WaterMark { get; set; }

Verify this feature by opening up one of the demo applications (eg.: PercentageUpDownDemo.xaml and add a Watermark string binding: image

Start the test application and verify the expectation that the Watermark is shown when the user deletes the complete textbox content: image