0

I have a default overview.xaml loaded into a frame with a listview and I want to redirect to a details page of the item that I double clicked. But how can I teach the details page which item has been double clicked?

void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
  //send post info of selected item or similar missing...
  this.Content = "Details.xaml";
}

Lösung:

this.NavigationService.Navigate(new Details(selectedItem)); //Details has a Constructor
CodingYourLife
  • 7,172
  • 5
  • 55
  • 69

1 Answers1

0

You can use Page.NavigationService to call the Navigate overload that accepts a navigationState object. Or you can just create a constructor for the Details page which accepts the selected item as input and rewrite your code to this.Content = new Details(mySelectedItem);

hbarck
  • 2,934
  • 13
  • 16
  • I just noticed that my redirect inside the frame doesn't work, it just sets the content to the string "Details.xaml". How is the code for the redirect of the frame inside the frame? – CodingYourLife May 12 '12 at 18:50
  • Ah, I think I got it: this.NavigationService.Navigate(new Details(selectedStudent)); – CodingYourLife May 12 '12 at 18:52