WPF/C#:框架 - 如何获得正在加载的新 html 页面的通知?
我在 WPF 窗口中有一个框架,用于加载 html 帮助文件以供查看 - 它位于网络驱动器上。在我的 html 文件中,有指向同一目录中其他 html 文件的链接。当我加载 html(绑定属性 source = htmlSource
)时,会触发该框架的 Navigating 事件。但是,当我单击该页面上的链接到同一目录中的另一个页面时,不会触发该事件。我已绑定到 OnTargetUpdated 事件,但该事件也仅在第一页上触发。我使用 INotifyPropertyChanged 作为绑定属性“source”。
基本上,任何链接似乎都不会对包含 HTML 的框架执行任何操作。它加载良好并且可见,只是无法注意到它的发生,所以我可以使后退按钮可见。尽管显示了链接的 html,但消息来源仍然说这是原始文件。
这真让我抓狂。任何帮助将不胜感激。
I have a frame in a WPF window that I'm using to load an html help file for viewing - it's on a network drive. In my html file, there are links to other html files in the same directory. When I load the html (bound property source = htmlSource
), the Navigating event is fired for the frame. However, when I click a link on that page to another in the same directory, that event is not fired. I've tied into an OnTargetUpdated event, but that only fires on the first page as well. I'm using INotifyPropertyChanged for the bound property "source".
Basically, any link doesn't seem to do anything with the frame containing the HTML. It loads in fine and is viewable, just can't get notice of it happening so I can make a back button visible. The source still says it's the original file, despite showing the linked html.
It's kinda driving me nuts. Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来你正在尝试融入 Html 世界,但还不够。如果您确实正在寻找“后退”按钮功能,则应该创建一个具有内联框架的父 HTML 页面,然后使用 JavaScript 函数来处理后退按钮功能。
Seems like you are trying to mix into the Html world, but not enough. If you are really looking for "Back" button functionality, you should just create a parent HTML page that has an inline Frame and then use JavaScript function to handle your back button functionality.