Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How do you prevent the VS Shell from getting priority on key/command bindings in a VSPackage ToolWindow?

$
0
0

I have a wpf user control that accepts input gestures to perform various commands. In the example image below, the user can press Ctrl+N to execute the "New" command to create a new item in the tree view.

enter image description here

When this user control is hosted within a WPF application, the user can create a new item using Ctrl+N when the focus is on the tree view, and when the user presses Ctrl+N when the focus is elsewhere in the application, the application level "New" command is executed.

When this user control is hosted within a VSPackage ToolWindow, the VS Shell level "New" command to create a new file is executed when the user presses Ctrl+N, regardless of focus on the tree view.

How do you prevent the VS Shell from getting priority on key/command bindings?



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>