void SetupDrawerContent(SupportDesign.NavigationView _navigationView)
 {
     try
     {
         _navigationView.NavigationItemSelected += (object sender, SupportDesign.NavigationView.NavigationItemSelectedEventArgs e) =>
         {
             e.MenuItem.SetChecked(true);
             drawerLayout.CloseDrawers();
         };
     }
     catch (Exception ex)
     {
         var msg = ex.Message;
     }
 }
Exemple #2
0
        private void NavigationView_NavigationItemSelected(object sender, Android.Support.Design.Widget.NavigationView.NavigationItemSelectedEventArgs e)
        {
            //Intent intent = new Intent(this, typeof(QuizDescriptionActivity));

            switch (e.MenuItem.ItemId)
            {
            case Resource.Id.navHistory:

                InitHistory();
                drawerLayout.CloseDrawers();
                break;

            case Resource.Id.navGeography:

                InitGeography();
                drawerLayout.CloseDrawers();
                break;

            case Resource.Id.navEngineering:

                InitEngineering();
                drawerLayout.CloseDrawers();
                break;

            case Resource.Id.navBusiness:

                InitBusiness();
                drawerLayout.CloseDrawers();
                break;

            case Resource.Id.navProgramming:

                InitProgramming();
                drawerLayout.CloseDrawers();
                break;

            case Resource.Id.navSpace:

                InitSpace();
                drawerLayout.CloseDrawers();
                break;

            default:
                break;
            }
        }