private void MainWindow_PreviewKeyDown(object sender, KeyEventArgs e) { if (newTagBox.IsFocused) { return; } // ReSharper disable once SwitchStatementMissingSomeCases switch (e.Key) { case Key.Left: ChangeImage(FilteredFileList.Delta.Prev); break; case Key.Right: ChangeImage(FilteredFileList.Delta.Next); break; case Key.Delete: CurrentFile.Delete(Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)); ChangeImage(); break; case Key.Space: ToggleFullScreen(); break; case Key.Escape: Close(); break; } }