Hi everybody. I'm using this controller's commands option. I'm following the guides and it works, however, whenever I try to navigate to another page, I get this error: "PushAsync is not supported globally on iOS, please use a NavigationPage.".
I tried moving my code from the ViewModel to the Content page where I invoque the view model. The tree lodes the data just fine, but now it won't recognize the tap action.
async void OnItemTap(object p)
{
var context = (TreeViewItemCommandContext)p;
var item = context.Item as ItemsArbol;
await Application.Current.MainPage.DisplayAlert("", "You clicked on: " + (context.Item as ItemsArbol).Nombre, "OK");
if (!Equals(item.Tipo, "0"))
{
idOrgMod = item.Id;
idOrgModPadre = item.Padre;
Application.Current.Properties["idOrgMod"] = idOrgMod;
Application.Current.Properties["idOrgModPadre"] = idOrgModPadre;
await Application.Current.SavePropertiesAsync();
await Navigation.PushAsync(new OrganizacionesDetalle());
}
}
How can I make the content view recognize the ItemTap action? In case this isn't possible, how can I make the viewmodel display the new page when I tap the tree's item?
Thanks in advance for your help.