This is the function that changes location:
string restaurantId = (string)e.Parameter;
Console.WriteLine(restaurantId);
await Shell.Current.GoToAsync($"location?restaurantId={restaurantId}");
Param is not undefined and it is consoled there. And the page changes, but the query param is empty string:
[QueryProperty("RestaurantId", "restaurantId")]
internal partial class LocationModel : ObservableObject
{
[ObservableProperty]
public string restaurantId;
public LocationModel()
{
Console.WriteLine(RestaurantId); // EMPTY
}
}
This is AppShell.cs
where routes are registered:
public partial class AppShell : Shell
{
public AppShell()
{
InitializeComponent();
Routing.RegisterRoute("login", typeof(LoginPage));
Routing.RegisterRoute("home", typeof(MainPage));
Routing.RegisterRoute("location", typeof(LocationPage));
}
}
What am I doing wrong?