Hello,
I have a ToolWindowPane with a toolbar, an embedded Editor (IWpfTextViewHost) and a Gridcontrol.
In the editor the user edits an SQL statement and after pressing a toolbar button the grid is filled with the query data.
When the user presses Del-Key in GridControl the Delete action takes place in the Editor :(
I think the problem is related to the IOleCommandTarget implementation routing all commands to the editor.
I think it should depend on focus, but I don't now to to achieve this ...
Here is my current implementation
int IOleCommandTarget.Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) { var hr = (int)Microsoft.VisualStudio.OLE.Interop.Constants.OLECMDERR_E_NOTSUPPORTED; if (pguidCmdGroup == GuidList.guidiNEXTCmdSet) // handling of own comands {
... code removed here
} else if (viewModel != null && viewModel.ViewAdapter != null) { var cmdTarget = (IOleCommandTarget)viewModel.ViewAdapter; hr = cmdTarget.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); } return hr; }
viewModel.ViewAdapter is a IVsTextView related to a IWpfTextViewHost
How can I query if TextView has focus or my GridControl has focus and route it to GridControl ?
best regards Stephan Hartmann ML-Software GmbH