public class DoubleUpDown : UpDownBase<double>
{
///<summary>
/// Internal constructor.
///</summary>
public DoubleUpDown( )
: base( )
{
Value = 0;
}
///<summary>
/// Called by OnSpin when the spin direction is SpinDirection.Increase.
///</summary>
protected override void OnIncrement( )
{
Value = Value + 1;
}
///<summary>
/// Called by OnSpin when the spin direction is SpinDirection.Increase.
///</summary>
protected override void OnDecrement( )
{
Value = Value - 1;
}
///<summary>
/// Called by ApplyValue to parse user input.
///</summary>
///<param name="text">User input.</param>
///<returns>Value parsed from user input.</returns>
protected override double ParseValue( string text )
{
return double.Parse( text, CultureInfo.CurrentCulture );
}
///<summary>
/// Called to render Value for Text template part to display.
///</summary>
///<returns>Formatted Value.</returns>
protected override string FormatValue( )
{
return Value.ToString( CultureInfo.CurrentCulture );
}
}