我想从 2 个不同的页面 p2 和 p3 导航到页面 p1。p2 和 p3 页都将参数传递给 p1 页。这是页面p2和p3的按钮代码
第 p2 页:
private void button1_Click_1(object sender, RoutedEventArgs e)
{
ListBoxItem l = (ListBoxItem)listBox1.SelectedItem;
string s = (string)l.Content;
NavigationService.Navigate(new Uri("/Page1.xaml?ok=" + s, UriKind.RelativeOrAbsolute));
}
第 3 页:
private void button1_Click_1(object sender, RoutedEventArgs e)
{
ListBoxItem l = (ListBoxItem)listBox1.SelectedItem;
string s = (string)l.Content;
NavigationService.Navigate(new Uri("/Page1.xaml?ko=" + s, UriKind.RelativeOrAbsolute));
}
我想知道 p1 页中 OnNavigatedTo 函数的代码,以便它可以接收两个参数并将它们显示在 2 个不同的文本块中。