EditorSearchView Customization

SyntaxEditor for WPF Forum

Posted 5 years ago by Scott Currie
Version: 14.2.0611
Avatar

I have customized the EditorSearchView via a Control template.  This enables me (among other things) to replace the standard FindWhatTextBox with an editable ComboBox that contains a list of past search terms.  But we only want that list to be updated when the user actually searches - not just when something is typed in.

Since EditorSearchView does not provide an event when searches are performed, the simplest way to populate those search terms would be to create a command binding onFindNextCommand.  Unfortunately, neither my handler for Executed or PreviewExecuted is being called.  I suspect that the Actipro code is firing on preview and setting Handled to true.

What is the best way to proceed?  I can certainly put a click handler on the "find next" button in my control template, but that won't fire when I press "Enter" from the FindWhatTextBox.

To work around that, I could set the "find next" button to IsDefault=true.  But when I do that, FindNextCommand fires twice for each press of the enter key - once for the IsDefault button and once for the EditorSearchView keybinding that you guys setup.

I can certainly think of ways to work around this, but they all feel sloppy.  Do you have any recommendations?

Comments (2)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Scott,

There is a SyntaxEditor.ViewSearch event that might be exactly what you need.  That fires anytime a search takes place.  Check that out and let us know if it helps.


Actipro Software Support

Posted 5 years ago by Scott Currie
Avatar

This is what I was looking for.  Thanks!

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.