Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Passing another view from an AlertView (?)

$
0
0

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 ();
    } 

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>