Reputation: 67
when user wins the game if he want to play the game again in this case page needs to reload again. for this I have tried the below code but exception has came.what is the correct way to reload a page.
NavigationService.Navigate(new Uri(string.Format("/NumericEasy.xaml"+
"?Refresh=true&random={0}", Guid.NewGuid())));
Upvotes: 0
Views: 1197
Reputation: 1139
I suppose, you're getting this exception:
Navigation is only supported to relative URIs that are fragments, or begin with '/', or which contain ';component/'
You should set the UriKind parameter. Change your code a bit:
NavigationService.Navigate(new Uri(string.Format("/NumericEasy.xaml?random={0}", Guid.NewGuid()), UriKind.Relative));
Upvotes: 1