框架与网络浏览器
如果我想要做的就是在 WPF 应用程序中显示某些网页的内容,那么使用 WebBrowser 控件与 Frame 控件相比有何优缺点?据我了解,无论如何,Frame 都会包装 WebBrowser。
我不需要在我的控件中显示 WPF,因此 Frame 的功能与我无关。
提前致谢。
If all I'm trying to do is display the contents of some web page in a WPF app, what are the pro's and cons of using the WebBrowser control versus the Frame control? As I understand it Frame wraps WebBrowser anyway.
I have no need to display WPF in my control so that feature of Frame doesn't concern me.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只想显示网页,我会使用 WebBrowser 控件。即使只是因为命名更有意义并且更容易一眼理解“框架”的用途。
If you're just wanting to display a webpage, I would use the WebBrowser control. Even if it's only for the reason that the naming makes more sense and is easier to understand at a glance what the "frame" is for.
“Frame”可以将 WPF 内容显示为子项,并且仅在显示“web”内容时才启动 IE ActiveX 控件。 (首先显示您的内部应用程序帮助内容或数据内容,然后提供指向网页的链接以获取其他详细信息。)我认为,如果您正在考虑通过 Web 内容增强 XAML 静态内容(1),那么 Frame 是最佳选择。
1 - 请参阅 FlowDocument
The 'Frame' can display WPF content as children, and spin-up the IE ActiveX control only when 'web' content is displayed. (Start by displaying your internal application help content or data content, then have a link to web page for additional details.) I think if you're considering XAML static content(1) augmented by web content then Frame is the best choice.
1 - see FlowDocument