How to create a Tokenizing Control for UWP as known from Outlook when using To, Cc and Bcc

此生再无相见时 提交于 2020-01-01 17:01:07

问题


There is a great article about how to write a Tokenizing Control for WPF here: Tokenizing control – convert text to tokens

But how is this accomplished in an UWP App? The Windows 10 UWP Mail client does this just fine, so I know that it is possible. But how?

Tokenizing is super useful for To/CC/BCC input areas, as we know it from Outlook and lately from the Windows 10 UWP Mail client.

I suspect that RichTextBlock or maybe RichEditBox combined with AutoSuggestBox could be part of the answer, but in the WPF example above FlowDocument is used and FlowDocumet is not supported in UWP.


回答1:


I haven't looked at their code. They likely have a text input control of their own, but you could achieve a fairly similar and possibly acceptable effect by putting (Rich)TextBox and "token" elements in a WrapPanel. You won't be able to easily select all text, but you could get clickable token elements. Otherwise - you might have a bit of work figuring out completely hand-crafted input and rendering.



来源:https://stackoverflow.com/questions/36237644/how-to-create-a-tokenizing-control-for-uwp-as-known-from-outlook-when-using-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!