Beispiel #1
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     //return base.OnOptionsItemSelected(item);
     switch (item.ItemId)
     {
     case Android.Resource.Id.Home:
         drawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.Start);
         return(true);
     }
     return(base.OnOptionsItemSelected(item));
 }
Beispiel #2
0
        //OnOptionsItemSelected is very important because it is the one responsible
        //in determining what is the menu that was clicked in your app and it's also
        //assigning the commands that will be executed when we click on a specific menu
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            //Android.Resource.Id.Home is the hamburger icon in the navigation drawer
            case Android.Resource.Id.Home:
                drawerLayout.OpenDrawer((int)GravityFlags.Left);
                return(true);

            default:
                return(base.OnOptionsItemSelected(item));
            }
        }