How can I keep PDFViewWPF from switching back to the pan tool after I highlight text?

Q:

I want to be able to switch to text highlighting and highlight multiple sections of text. But PDFViewWPF automatically switches back to pan mode each time. So I have to keep manually going back into highlight mode after each operation. How can I keep it in highlight mode?

A:

In PDFViewWPF, the text highlight modes are handled by the tools library, PDFViewWPFTools. Specifically, the ProcessInputUp method of TextMarkupCreate.cs calls EndCurrentTool(ToolManager.ToolType.e_pan), so that after the highlight finishes the tool returns to pan mode. Simply comment out this line to return to the previous behaviour.

Note, of course, that this will apply to all markup tools — so this behaviour would also apply to text strikeout, underline, and squiggly.