I'm trying to create a simple windows phone 8.1 application using JSON. And my question is how after clicking an item from the ListView can I open a second page with data related to the selected item?
public MainPage()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
var client = new HttpClient();
var task = client.GetAsync("json")
.ContinueWith((taskwithresponse) =>
{
var response = taskwithresponse.Result;
var jsonString = response.Content.ReadAsStringAsync();
jsonString.Wait();
dynamic content = JsonConvert.DeserializeObject<RootObject>(jsonString.Result);
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(() =>
{
List.ItemsSource = content.value.items;
})).AsTask().Wait();
});
}
private void listView_ItemClick(object sender, RoutedEventArgs e)
{
this.Frame.Navigate(typeof(SecondPage));
}