Hi! Im a newbie with Xamarin and need help :/
This function is called when the user selects a cell in a table, and displays a AlertView with two buttons, "OK" and "VerDetalles". It works when I click on "OK", but when I click on "VerDetalles" does not change to another view. How could it work? How I can do to call another view from the button AlertView? Thanks!
public override void RowSelected (UITableView tableView, NSIndexPath indexPath) { int buttonClicked = -1;
UIAlertView alert = new UIAlertView(tableItems[indexPath.Row].numero_credito, "Estado:" + tableItems[indexPath.Row].estado, null, "Volver", "Ver Detalles");
tableView.DeselectRow (indexPath, true);
alert.Clicked += (sender, buttonArgs) =>
{
if (buttonArgs.ButtonIndex == 0) //OK Clicked
{
Console.WriteLine("Ok clicked");
}
//---------------- if (buttonArgs.ButtonIndex == 1) //Pass another view!!! { Details prueba = new Details(); //Details es la siguiente vista... UINavigationController controller = new UINavigationController(); parentViewController.NavigationController.PushViewController(prueba, true);
}
};
alert.Show ();
}