Slider.OnKeyDown Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Provides class handling for the UIElement.KeyDown event.
Assembly: System.Windows (in System.Windows.dll)
Parameters
- e
- Type: System.Windows.Input.KeyEventArgs
A KeyEventArgs that contains the event data.
This implementation increments or decrements the Value property by the SmallChange value according to the following table
Key Pressed | Slider direction | Result |
|---|---|---|
Default | Increment | |
Reversed | Decrement | |
Default | Decrement | |
Reversed | Increment |
The OnKeyDown method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to InheritorsWhen overriding OnKeyDown in a derived class, make sure to call the base class’s OnKeyDown method so that registered delegates receive the event.