public static bool IsNavigationKey(this Key key) { bool result = false; switch (key) { case Key.Left: case Key.Up: case Key.Right: case Key.Down: case Key.Escape: result = true; break; default: // Do nothing break; } return result; }