private static void HandleKeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.Enter)
{
_isEnterPressed = true;
var cmd = ((UIElement) sender).GetValue(CommandProperty) as ICommand;
if (cmd != null && cmd.CanExecute(null))
{
_command = cmd;
}
}
}