How to build a “word-by-word” autocomplete in WPF?

前端 未结 4 1806
臣服心动
臣服心动 2021-02-07 16:21

I already did some research and ended up with several autocomplete boxes which have one thing in common: they all match the whole expression which has been entered. Sometimes, t

相关标签:
4条回答
  • 2021-02-07 16:49

    I think you mean a textbox which autocomplete for multiple words. Like TokenizedTexbox on WPF Extended Toolkit. this is the page: http://wpftoolkit.codeplex.com/wikipage?title=TokenizedTextBox&referringTitle=Home

    0 讨论(0)
  • 2021-02-07 17:04

    Check this implementation out: http://code.google.com/p/kocontrols/downloads/list You may inject your own Search algorithm and your own converter which converts the selected element to text, which you display in the TextBox. You will have to modify it slightly but I think that you might be able to solve your problem by basing your control on this implementation. I never thought about this type of use case. Can't you use different textboxes for the different tags? Something similar to how goole code does it?

    0 讨论(0)
  • 2021-02-07 17:05

    If you have time, you can use the RichEditControl or TextBox and apply the same pattern used in Intellisense engine or Code Completation enabled editors: Hook the text changes events, Recogize context (last/current word) and display the options list on popup control. And optionally, on commit (detect acceptation or space key), apply the format to the word.

    0 讨论(0)
  • 2021-02-07 17:12

    Probably you would need to create your own Dictionary object of Key and Value pairs and hook that Dictionary to the textbox events and popup a suggestions dialog that displays the Value(s) from your Dictionary

    0 讨论(0)
提交回复
热议问题