对于我正在开发的应用程序,我想使用带有三个WebView的Hub,您可以滚动浏览。我曾尝试:集线器中的WebViews Windows Phone 8.1
干脆把在轮毂部web视图(这不工作 - 需要一个DataTemplate)
把一个DataTemplate内的WebView在HubSection(此编译,但web视图不是后面的代码)
使用以下代码来试图找到控制视觉,而使用上述方法可访问:
public static T FindVisualChildByName<T>(DependencyObject parent, string name) where T : DependencyObject { for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) { var child = VisualTreeHelper.GetChild(parent, i); string controlName = child.GetValue(Control.NameProperty) as string; if (controlName == name) { return child as T; } else { T result = FindVisualChildByName<T>(child, name); if (result != null) return result; } } return null; }
这没有找到任何视觉元素。我怎么能有一个WebViews的中心内?
谢谢!标记为答案。 – SFX 2014-12-01 19:44:25