如何在使用收件人、抄送和密件抄送时从 Outlook 中创建 UWP 的标记化控制

编程入门 行业动态 更新时间:2024-10-08 00:35:23
本文介绍了如何在使用收件人、抄送和密件抄送时从 Outlook 中创建 UWP 的标记化控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

这里有一篇很棒的文章,介绍了如何为 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 的标记化控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 04:42:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1388935.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密件   收件人   标记   如何在   UWP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!