Gu.Wpf.NumericInput icon indicating copy to clipboard operation
Gu.Wpf.NumericInput copied to clipboard

IncrementStrategy

Open JohanLarsson opened this issue 9 years ago • 3 comments

  • TruncateToLimit
  • DisabledIfOverflow
  • Overflow

JohanLarsson avatar Jul 08 '16 14:07 JohanLarsson

/// <summary>
/// Controls how increment and decrement behaves.
/// </summary>
public enum IncrementMode
{
    /// <summary>
    /// Truncate to the limit if overflow would have happened.
    /// </summary>
    Truncate,

    /// <summary>
    /// Add the increment even if it overflows the limit.
    /// </summary>
    Overflow,

    /// <summary>
    /// Don't allow incrementing if the limit would be overflown.
    /// </summary>
    DisableIfOverflow,
}

JohanLarsson avatar Jun 21 '17 19:06 JohanLarsson

  • BoundaryPolicy
  • OnLimitReached (kind of meh since it has a silly callback-like name)

milleniumbug avatar Jun 21 '17 19:06 milleniumbug

BoundaryPolicy is nice, thanks!

/// <summary>
/// Controls how increment and decrement behaves.
/// </summary>
public enum BoundaryPolicy
{
    /// <summary>
    /// Truncate to the limit if overflow would have happened.
    /// </summary>
    Truncate,

    /// <summary>
    /// Add the increment even if it overflows the limit.
    /// </summary>
    Overflow,

    /// <summary>
    /// Don't allow incrementing or decrementing if the limit would be overflown.
    /// </summary>
    Disable,
}

JohanLarsson avatar Jun 21 '17 20:06 JohanLarsson