这个问题,纠结了一天了,把百度的前20页都看了一个遍,也有能成功弹出的,但都不是自己想要的那种效果,功夫不负有心人啊,我终于找到了一个跟自己想要的效果一样的了,赶紧记录下来:
首先要修改App.xaml.cs:
private void Application_Startup(object sender, StartupEventArgs e)
{
IDictionary<string, string> tiaozhuan= HtmlPage.Document.QueryString;
if (tiaozhuan== null || tiaozhuan.Count < 1 || !tiaozhuan.ContainsKey("yemian"))
{
this.RootVisual = new MainPage();
}
else
{
string tiaozhuanyemian= tiaozhuan["yemian"];
switch (tiaozhuanyemian)
{
case "text":
{
this.RootVisual = new text();
}
break;
case "text1":
{
this.RootVisual = new text1();
}
break;
default:
{
throw new Exception("Error!");
}
}
}
}
调用时:private void button1_Click(object sender, RoutedEventArgs e)
{
HtmlPage.Window.Navigate(new Uri("http://localhost:6323/RadUploadTestPage.aspx?page=text1", UriKind.RelativeOrAbsolute), "_blank");
}
private void button2_Click(object sender, RoutedEventArgs e)
{
HtmlPage.Window.Navigate(new Uri("http://localhost:6323/RadUploadTestPage.aspx?page=text", UriKind.RelativeOrAbsolute), "_blank");
}
今天在寻找方法的时候在一些群里好像是说有别的方法,不过本人愚笨,没听明白,有哪儿位大侠知道的,麻烦留言说一下。谢啦!
原文来自:http://www.cnblogs.com/yinxiangpei/archive/2012/08/06/2625580.html(感谢博主的分享)