示例#1
0
        public void SelectedItemChanged(int position, string label)
        {
            switch (label)
            {
            case "Home":
            {
                var calcFrag    = new CalcFragment();
                var transaction = SupportFragmentManager.BeginTransaction();
                transaction.Replace(Resource.Id.fragment_container, calcFrag, CalcFragTag);
                transaction.Commit();
                SlidingMenu.ShowContent();
            }
            break;

            case "Help":
            {
                Toast.MakeText(this.SupportActionBar.ThemedContext, "help clicked", ToastLength.Short).Show();
            }
            break;

            case "About":
            {
                var aFrag       = new AboutFragment();
                var transaction = SupportFragmentManager.BeginTransaction();
                transaction.Replace(Resource.Id.fragment_container, aFrag);
                transaction.Commit();
                SlidingMenu.ShowContent();
            }
            break;

            default:
                throw new InvalidOperationException();
            }
        }
示例#2
0
 public void SelectedItemChanged(int position, string label)
 {
     switch (label)
     {
         case "Home":
             {
                 var calcFrag = new CalcFragment();
                 var transaction = SupportFragmentManager.BeginTransaction();
                 transaction.Replace(Resource.Id.fragment_container, calcFrag, CalcFragTag);
                 transaction.Commit();
                 SlidingMenu.ShowContent();
             }
             break;
         case "Help":
             {
                 Toast.MakeText(this.SupportActionBar.ThemedContext, "help clicked", ToastLength.Short).Show();
             }
             break;
         case "About":
             {
                 var aFrag = new AboutFragment();
                 var transaction = SupportFragmentManager.BeginTransaction();
                 transaction.Replace(Resource.Id.fragment_container, aFrag);
                 transaction.Commit();
                 SlidingMenu.ShowContent();
             }
             break;
         default:
             throw new InvalidOperationException();
     }
 }