Reputation: 1
I have this unusual issues to navigate in Windows Phone 8.1
Here is my code :
try
{
news c = news_List.SelectedItem as news;
Frame.Navigate(typeof(Pages.newsItem), c);
}
catch(Exception ex)
{
MessageDialog j = new MessageDialog(ex.Message);
await j.ShowAsync();
}
So the problem is for Windows Phone 8.1, sometimes when I click on the element the application crash, and that's it nothing else. On debug mode nothing appends, and on Windows 10 Mobile it works like a charm...
Upvotes: 0
Views: 70
Reputation: 1113
Use this
try
{
news c = news_List.SelectedItem as news;
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => this.Frame.Navigate(typeof(Pages.newsItem), c));
}
catch(Exception ex)
{
MessageDialog j = new MessageDialog(ex.Message);
await j.ShowAsync();
}
and don't forget to add async in the method and make sure that you are getting the data on another page.
Upvotes: 1
Reputation: 876
use
news c = news_List.SelectedItem as news;
Frame.Navigate(typeof(PageName),c);
Upvotes: 0