I found the Key class for determining key input in a textbox but it seems to be just for wpf. How do I use it in Silverlight?
https://msdn.microsoft.com/en-us/library/aa274297(v=vs.60).aspx
I found the Key class for determining key input in a textbox but it seems to be just for wpf. How do I use it in Silverlight?
https://msdn.microsoft.com/en-us/library/aa274297(v=vs.60).aspx
I'm only aware of the Key
enum in Silverlight; it contains the keys available on a keyboard so if you receive keyboard input you can determine which key was pressed and react accordingly. An examle:
public DropDownButton()
{
DefaultStyleKey = typeof( DropDownButton );
KeyDown += HandleEscapeKey;
}
private void HandleEscapeKey( object sender, KeyEventArgs e )
{
if (e.Key == Key.Escape && IsDropDownOpen)
{
CloseDropDown();
e.Handled = true;
}
}