Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. private void Button_Click(object sender, RoutedEventArgs e)
  2. {
  3. string uri = string.Format("/Pagina2.xaml?nomeParametro={0}", txtValor.Text);
  4.  
  5. NavigationService.Navigate(new Uri(uri, uriKind.Relative));
  6. }
  7.  
  8. protected override void OnNavigatedTo(NavigationEventArgs e)
  9. {
  10. if (NavigationContext.QueryString["nomeParametro"] != null)
  11. txtParametro.Text = NavigationContext.QueryString["nomeParametro"];
  12.  
  13. base.OnNavigatedTo(e);
  14. }
  15.  
  16. private void Button_Click(object sender, RoutedEventArgs e)
  17. {
  18. string parametro = txtValor.Text;
  19. this.Frame.Navigate(typeof(Pagina2), parametro);
  20. }
  21.  
  22. protected override void OnNavigatedTo(NavigationEventArgs e)
  23. {
  24. txtParametro.Text = (string)e.Parameter;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement