.net 如何在Windows 8(metro)应用程序中访问子元素
我有一个usercontrol,它包含WebView控件。这个用户控件放在MainPage.xaml[MyUserControl1]中。如何通过MyUserControl1访问网络视图?您能与我们分享您的代码吗? 这个答案完全基于我对您如何创建用户控件的假设:) 当然,我可以创建返回webview的方法,但当我需要访问usercontrol中的其他控件时,该怎么办?当然,使用visualeditor:D,我可以创建返回webview的方法,但是,当我需要访问usercontrol中的其他控件时,该怎么办?.net 如何在Windows 8(metro)应用程序中访问子元素,.net,xaml,microsoft-metro,windows-runtime,visual-studio-2012,.net,Xaml,Microsoft Metro,Windows Runtime,Visual Studio 2012,我有一个usercontrol,它包含WebView控件。这个用户控件放在MainPage.xaml[MyUserControl1]中。如何通过MyUserControl1访问网络视图?您能与我们分享您的代码吗? 这个答案完全基于我对您如何创建用户控件的假设:) 当然,我可以创建返回webview的方法,但当我需要访问usercontrol中的其他控件时,该怎么办?当然,使用visualeditor:D,我可以创建返回webview的方法,但是,当我需要访问usercontrol中的其他控件时,
public class MyUserControl1: UserControl
{
private WebView wb = new WebView();
public MyControl()
{
this.Controls.Add( wb);
}
public WebView GetWebView
{
get { return wb; }
}
}