本文介绍了如何在使用收件人、抄送和密件抄送时从 Outlook 中创建 UWP 的标记化控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里有一篇很棒的文章,介绍了如何为 WPF 编写标记化控件:

但是这是如何在 UWP 应用中完成的?Windows 10 UWP 邮件客户端做得很好,所以我知道这是可能的.但是如何?

令牌化对于 To/CC/BCC 输入区域非常有用,正如我们从 Outlook 和最近从 Windows 10 UWP 邮件客户端了解到的那样.

我怀疑 RichTextBlock 或 RichEditBox 与 AutoSuggestBox 结合可能是答案的一部分,但在上面的 WPF 示例中使用了 FlowDocument,而 UWP 不支持 FlowDocumet.

解决方案

我没看过他们的代码.它们可能有自己的文本输入控件,但您可以通过将 (Rich)TextBox 和token"元素放在 WrapPanel 中来实现相当相似且可能可接受的效果.您将无法轻松选择所有文本,但可以获得可点击的标记元素.否则 - 您可能需要做一些工作来弄清楚完全手工制作的输入和渲染.

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.

解决方案

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.

这篇关于如何在使用收件人、抄送和密件抄送时从 Outlook 中创建 UWP 的标记化控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 02:17