C# Class Btl.Controls.SpinnerControl

Interaction logic for SpinnerControl.xaml
Inheritance: System.Windows.Controls.UserControl
Show file Open project: barrylapthorn/countdown_timer Class Usage Examples

Private Properties

Property Type Description
CoerceValue object
InitializeCommands void
LimitValueByBounds decimal
OnValueChanged void
SpinnerControl System

Protected Methods

Method Description
OnDecrease ( ) : void
OnDecreaseCommand ( Object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void
OnIncrease ( ) : void
OnIncreaseCommand ( Object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void
OnValueChanged ( RoutedPropertyChangedEventArgs e ) : void

Raise the ValueChanged event. Derived classes can use this.

UpdateFormattedValue ( decimal newValue ) : void

Update the formatted value.

Private Methods

Method Description
CoerceValue ( DependencyObject obj, object value ) : object
InitializeCommands ( ) : void

Since we're using RoutedCommands for the up/down buttons, we need to register them with the command manager so we can tie the events to callbacks in the control.

LimitValueByBounds ( decimal newValue, SpinnerControl control ) : decimal
OnValueChanged ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs args ) : void

If the value changes, update the text box that displays the Value property to the consumer.

SpinnerControl ( ) : System

Method Details

OnDecrease() protected method

protected OnDecrease ( ) : void
return void

OnDecreaseCommand() protected static method

protected static OnDecreaseCommand ( Object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void
sender Object
e System.Windows.Input.ExecutedRoutedEventArgs
return void

OnIncrease() protected method

protected OnIncrease ( ) : void
return void

OnIncreaseCommand() protected static method

protected static OnIncreaseCommand ( Object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void
sender Object
e System.Windows.Input.ExecutedRoutedEventArgs
return void

OnValueChanged() protected method

Raise the ValueChanged event. Derived classes can use this.
protected OnValueChanged ( RoutedPropertyChangedEventArgs e ) : void
e RoutedPropertyChangedEventArgs
return void

UpdateFormattedValue() protected method

Update the formatted value.
protected UpdateFormattedValue ( decimal newValue ) : void
newValue decimal
return void