问题描述
我正在尝试在 UWP 自定义组件中使用 RichEditBox,该组件将通过 XamlIslands 添加到 WPF 应用程序:
<RichEditBox x:Name="editor" Pointerpressed="editor_Pointerpressed" Tapped="editor_Tapped" PointerReleased="editor_Pointerpressed">
editor.Document.Selection.Link = "\"[the link]\"";
它工作正常,当 Ctrl+单击它时它会在浏览器中打开链接,但我如何捕捉该单击事件?
没有触发我在 RichEditBox 中定义为参数的回调,因此根本没有触发 Pointerpressed、PointerReleased 和 Tapped 事件。
解决方法
如何在 UWP RichEditBox 中捕获超链接点击?
恐怕你无法检测到超链接点击事件,目前还没有可以检测点击动作的api,如果你确实想要这个功能,请在windows feed back hub应用中发布你的需求。