base.OnFocusLost();
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool OnKey(Key key)
+ {
+ // TODO : Add IsEnabled conditional later.
+ if (null == key)
+ {
+ return false;
+ }
+
+ if (key.State == Key.StateType.Down)
+ {
+ if ((direction == DirectionType.Horizontal && key.KeyPressedName == "Left") ||
+ (direction == DirectionType.Vertical && key.KeyPressedName == "Down"))
+ {
+ if (MinValue < CurrentValue)
+ {
+ isPressed = true;
+ if (IsDiscrete)
+ {
+ float value = CurrentValue - discreteValue;
+ CurrentValue = value < MinValue ? MinValue : value;
+ }
+ else
+ {
+ CurrentValue -= 1;
+ }
+ return true; // Consumed
+ }
+ }
+ else if ((direction == DirectionType.Horizontal && key.KeyPressedName == "Right") ||
+ (direction == DirectionType.Vertical && key.KeyPressedName == "Up"))
+ {
+ if (MaxValue > CurrentValue)
+ {
+ isPressed = true;
+ if (IsDiscrete)
+ {
+ float value = CurrentValue + discreteValue;
+ CurrentValue = value > MaxValue ? MaxValue : value;
+ }
+ else
+ {
+ CurrentValue += 1;
+ }
+ return true; // Consumed
+ }
+ }
+ }
+ else if (key.State == Key.StateType.Up)
+ {
+ isPressed = false;
+ }
+
+ return false;
+ }
+
/// <summary>
/// Apply style to scrollbar.
/// </summary>
}
/// <summary>
- /// Minimum value.
+ /// Gets minimum value for Accessibility.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override double AccessibilityGetMinimum()
}
/// <summary>
- /// Current value.
+ /// Gets the current value for Accessibility.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override double AccessibilityGetCurrent()
}
/// <summary>
- /// Maximum value.
+ /// Gets maximum value for Accessibility.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override double AccessibilityGetMaximum()
}
/// <summary>
- /// Current value.
+ /// Sets the current value using Accessibility.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override bool AccessibilitySetCurrent(double value)
{
- var f = (float)value;
+ var current = (float)value;
- if (f >= MinValue && f <= MaxValue)
+ if (current >= MinValue && current <= MaxValue)
{
- CurrentValue = f;
+ CurrentValue = current;
if (sliderValueChangedHandler != null)
{
- sliderValueChangedHandler(this, new SliderValueChangedEventArgs { CurrentValue = f });
+ sliderValueChangedHandler(this, new SliderValueChangedEventArgs { CurrentValue = current });
}
return true;
}
}
/// <summary>
- /// Minimum increment.
+ /// Gets minimum increment for Accessibility.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override double AccessibilityGetMinimumIncrement()