超链接可以在 WPF 控件中显示的 XPS 文件中使用吗?
我正在尝试为软件应用程序创建帮助系统。该界面是用 WPF 编写的。我有一个 XPS 文件(由 Word 文档生成),我想从应用程序访问该文件。 XPS 文件包含在 XPS 文件内重定向的超链接。我可以使用 DocumentViewer 控件显示该文件,但超链接不起作用。 (当我在 XPS 查看器中查看相同的 XPS 文件时,超链接起作用。)我是 WPF 新手,所以我可能会忽略一些东西,但我已经尝试使这项工作工作一周了,尽管我'我一路学习,但我对手头的任务却一无所获。我将非常感谢任何帮助。 -戴夫
I'm trying to create a help system for a software application. The interface is written in WPF. I have an XPS file (produced from a Word doc) that I want to access from the application. The XPS file contains hyperlinks that redirect within the XPS file. I can display the file using the DocumentViewer control, but the hyperlinks don't work. (When I view the same XPS file in the XPS Viewer, the hyperlinks work.) I'm new to WPF, so I may be overlooking something, but I've been trying to make this work for a week now and though I'm learning along the way I'm not getting anywhere with the task at hand. I'd greatly appreciate any help.
-Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在代码后面添加以下代码以手动处理超链接:
Add the following code in your code behind to handle the hyperlinks manually:
我知道这是一个老问题,但对于任何寻找答案的人来说,我认为问题是超链接只能在导航容器(框架或导航窗口)内工作,因此您必须将 DocumentViewer 放在导航容器中。
I know this is old question, but to anyone looking for an answer, I think the problem is that hyperlinks work only within a navigation container - Frame or NavigationWindow, so you must place DocumentViewer in navigation container.