-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
I am trying to implement solution with INavigationParameterReceiver from Chapter 08/Passing parameters section, but there is receiver is null here:
public class NavigationService : INavigationService
{
public Task GoBack() => Shell.Current.GoToAsync("..");
public Task GoToXXX(string name) => Navigate("xxx",
new ()
{
{
"name", name
}
}
);
private static async Task Navigate(string pageName, Dictionary<string, object> parameters)
{
await Shell.Current.GoToAsync(pageName);
if (Shell.Current.CurrentPage.BindingContext is INavigationParameterReceiver receiver) // here receiver is null
{
receiver.OnNavigatedTo(parameters);
}
}
}
Should I register INavigationParameterReceiver somehow?
Edit: I am debuging my code and Shell.Current.CurrentPage.BindingContext is null, but I don't know why.
I use DI to inject my VMs and here is the class for page:
public partial class XXXPage: ContentView
{
public XXXPage()
{
InitializeComponent();
BindingContext = ServiceHelper.GetService<XXXVM>();
}
}
Metadata
Metadata
Assignees
Labels
No labels