I try to port some Windows Phone 8 projects to current UWP, and get stucked in this snippet code that I've used in old project.
private void Restaurant_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
string types = "restaurant";
string title = "restaurant";
string url = string.Format("/NearbyPlaces.xaml?latitude={0}&longitude={1}&types={2}&title={3}", LocationLatitude.Text, LocationLangitude.Text, types, title);
NavigationService.Navigate(new Uri(url, UriKind.Relative));
}
In that code, I used NavigationService to pass some parameters to another page. I couldn't use NaigationService anymore because UWP doesn't support it. I've tried using this in my UWP project, but I think it only supported for passing one parameter, CMIIW.
private void restaurant_tapped(object sender, TappedRoutedEventArgs e)
{
string types = "restaurant";
string title = "restaurant";
Frame.Navigate(typeof(placeResult), latLoc.Text, longLoc.Text, types, title);
}
That code give me an error, because it takes 5 arguments, which is +2 overloads. My question is how to do in proper way to passing some parameters in UWP project?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…