在Gridview数据模板中访问Webview [英] Access Webview inside Gridview datatemplate
问题描述
我将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屋!