下面是我用来将网络浏览器添加到弹出控件但似乎不起作用的代码片段。
Popup codePopup = new Popup();
StackPanel test = new StackPanel();
WebBrowser wb1 = new WebBrowser();
wb1.Navigated += wb1_Navigated;
wb1.Navigate(new Uri(@"http://www.google.com"));
test.Children.Add(wb1);
test.Height = Application.Current.Host.Content.ActualHeight;
test.Width = Application.Current.Host.Content.ActualWidth;
codePopup.Child = test;
this.LayoutRoot.Children.Add(codePopup);
codePopup.IsOpen = true;