C# Класс DynamicVizSegmenter.CustomControls.NumericUpDownTextBox

Interaction logic for NumericUpDownTextBox.xaml
Наследование: System.Windows.Controls.TextBox
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ButtonBackgroundProperty System.Windows.DependencyProperty
ButtonBorderBrushProperty System.Windows.DependencyProperty
ButtonBorderThicknessProperty System.Windows.DependencyProperty
ButtonCornerRadiusProperty System.Windows.DependencyProperty
ButtonForegroundProperty System.Windows.DependencyProperty
ButtonMouseOverBackgroundProperty System.Windows.DependencyProperty
ButtonPressedBackgroundProperty System.Windows.DependencyProperty
DelayProperty System.Windows.DependencyProperty
IntervalProperty System.Windows.DependencyProperty
MaxValueProperty System.Windows.DependencyProperty
MinValueProperty System.Windows.DependencyProperty
ValueProperty System.Windows.DependencyProperty

Открытые методы

Метод Описание
NumericUpDownTextBox ( ) : System

Constructor: initializes the TextBox, creates the buttons, and attaches event handlers for the buttons and TextBox

Защищенные методы

Метод Описание
ArrangeOverride ( Size arrangeSize ) : Size

Called to arrange and size the content of a System.Windows.Controls.Control object.

GetVisualChild ( int index ) : Visual

Overrides System.Windows.Media.Visual.GetVisualChild(System.Int32), and returns a child at the specified index from a collection of child elements.

Приватные методы

Метод Описание
Add ( int value ) : void

Works directly with the Value property to increment or decrement the integer value in the textbox

ButtonPropertyChangedCallback ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
ButtonTimerCallback ( Object sender ) : void
Button_Click ( object sender, RoutedEventArgs e ) : void

Handles up button click (ie increment TextBox value)

Button_PreviewMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

When mouse button is depressed over the up or down button, initiates the RepeatButton behaviour by setting up a timer

Button_PreviewMouseUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Resets the repeat button so no longer active when Mouse button released Does not matter if mouse is on button or not

FixValue ( ) : int

Only does something if the Textbox contains an out of range number

FixValueKeyPress ( int value ) : bool

Will fix value only if the value is beyond what could be a valid entry given more characters could be added to TextBox

HandleModifiers ( int value ) : void

Checks if any of the Keyboard modifier keys are pressed that might affect the change in the value of the TextBox. In this case only the shift key affects the value

MinMaxValueChangedCallback ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnValueChanged ( ) : void
RepeatButtonCallback ( object o ) : void

Observes the button timer event for the repeat button functionality, and then starts the 'Value' dependency property change process Note: Cannot interact directly with UI from this event

RepeatButtonDispatched ( int value ) : void

Checks that mouse cursor is in the button, and if so updates the 'Value' dependency property

UpdateText ( int value ) : void
ValueChangedCallback ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
control_LostFocus ( object sender, RoutedEventArgs e ) : void
control_PreviewKeyDown ( object sender, System.Windows.Input.KeyEventArgs e ) : void

Checks if the keypress is the up or down key, and then handles keyboard input

control_PreviewTextInput ( object sender, System.Windows.Input.TextCompositionEventArgs e ) : void

Ensures that keypress is a valid character (numeric or negative sign) - negative sign ('-') only allowed if Minimum value less than 0, the entry is at the beginning of the text and there is not already a negative sign - number only allowed if not beginning of text and there is a negative sign

Описание методов

ArrangeOverride() защищенный Метод

Called to arrange and size the content of a System.Windows.Controls.Control object.
protected ArrangeOverride ( Size arrangeSize ) : Size
arrangeSize System.Windows.Size The computed size that is used to /// arrange the content
Результат System.Windows.Size

GetVisualChild() защищенный Метод

Overrides System.Windows.Media.Visual.GetVisualChild(System.Int32), and returns a child at the specified index from a collection of child elements.
protected GetVisualChild ( int index ) : Visual
index int The zero-based index of the requested child element in the collection.
Результат Visual

NumericUpDownTextBox() публичный Метод

Constructor: initializes the TextBox, creates the buttons, and attaches event handlers for the buttons and TextBox
public NumericUpDownTextBox ( ) : System
Результат System

Описание свойств

ButtonBackgroundProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonBackgroundProperty
Результат System.Windows.DependencyProperty

ButtonBorderBrushProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonBorderBrushProperty
Результат System.Windows.DependencyProperty

ButtonBorderThicknessProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonBorderThicknessProperty
Результат System.Windows.DependencyProperty

ButtonCornerRadiusProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonCornerRadiusProperty
Результат System.Windows.DependencyProperty

ButtonForegroundProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonForegroundProperty
Результат System.Windows.DependencyProperty

ButtonMouseOverBackgroundProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonMouseOverBackgroundProperty
Результат System.Windows.DependencyProperty

ButtonPressedBackgroundProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonPressedBackgroundProperty
Результат System.Windows.DependencyProperty

DelayProperty публичное статическое свойство

public static DependencyProperty,System.Windows DelayProperty
Результат System.Windows.DependencyProperty

IntervalProperty публичное статическое свойство

public static DependencyProperty,System.Windows IntervalProperty
Результат System.Windows.DependencyProperty

MaxValueProperty публичное статическое свойство

public static DependencyProperty,System.Windows MaxValueProperty
Результат System.Windows.DependencyProperty

MinValueProperty публичное статическое свойство

public static DependencyProperty,System.Windows MinValueProperty
Результат System.Windows.DependencyProperty

ValueProperty публичное статическое свойство

public static DependencyProperty,System.Windows ValueProperty
Результат System.Windows.DependencyProperty