我可以使用Btn_Click方法调用NavigationService
private void Com_Click(object sender, RoutedEventArgs e)
{ string test = "Com";
var x = NavigationService.Navigate(new Uri(@"/PageList.xaml" + "?msg1=" + test, UriKind.Relative));
}但是我不能以这种方式调用相同的服务
public MainPage()
{
InitializeComponent();
...
Test();
}
private void Test()
{ string test = "Com";
var x = NavigationService.Navigate(new Uri(@"/PageList.xaml" + "?msg1=" + test, UriKind.Relative));
}发布于 2015-10-07 16:08:31
在没有var x =的情况下尝试:
private void Test()
{
string test = "Com";
NavigationService.Navigate(new Uri(@"/PageList.xaml" + "?msg1=" + test, UriKind.Relative));
}https://stackoverflow.com/questions/32933713
复制相似问题