在Gridview数据模板中访问Webview [英] Access Webview inside Gridview datatemplate

查看:98
本文介绍了在Gridview数据模板中访问Webview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Webview作为Gridview数据模板中的控件之一。我如何访问和绑定数据到Gridview内的这个Webview。

我试过VisualTreeHelper.GetChildren方法。但不能成功。请帮助。

解决方案

能够使用相同的VisualTreeHelper.GetChildren方法解决问题。以前我是将子控件解析为控件类型。由于WebView是一个框架元素,我没有得到WebView控件。现在,当我尝试解析为FramewoekElement时,我能够获得它。仍然想知道是否会有更好的解决方案?


I have Webview as one of the control inside Gridview datatemplate. How would i access and bind data to this Webview inside Gridview.

I have tried VisualTreeHelper.GetChildren method. But could not succeed. Please help.

解决方案

Able to resolve with same VisualTreeHelper.GetChildren method. Previously i was parsing child controls as Control type. Since WebView is a Framework element I did not get WebView control. Now when I try to parse as FramewoekElement, I am able to get it. Still wondering if there would be any better solution??

这篇关于在Gridview数据模板中访问Webview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆