Example #1
0
		void HandleSectionItemClick (object sender, AdapterView.ItemClickEventArgs e)
		{
			switch (e.Position) {
			case 0:
				if (mapFragment == null)
					mapFragment = new HubwayMapFragment (this);
				SwitchTo (mapFragment);
				break;
			case 1:
				if (favoriteFragment == null) {
					favoriteFragment = new FavoriteFragment (this, id => {
						SwitchTo (mapFragment);
						mapFragment.CenterAndOpenStationOnMap (id,
						                                       zoom: 17,
						                                       animDurationID: Android.Resource.Integer.ConfigLongAnimTime);
					});
				}
				SwitchTo (favoriteFragment);
				break;
			case 2:
				if (rentalFragment == null)
					rentalFragment = new RentalFragment (this);
				SwitchTo (rentalFragment);
				break;
			default:
				return;
			}
			SetSelectedMenuIndex (e.Position);
			drawerMenu.SetItemChecked (e.Position, true);
			drawer.CloseDrawers ();
		}
        void SwitchToSectionPosition(int position)
        {
            switch (position)
            {
            case 0:
                if (mapFragment == null)
                {
                    mapFragment = new HubwayMapFragment();
                }
                SwitchTo(mapFragment);
                break;

            case 1:
                if (favoriteFragment == null)
                {
                    favoriteFragment = new FavoriteFragment();
                }
                SwitchTo(favoriteFragment);
                break;

            case 2:
                if (rentalFragment == null)
                {
                    rentalFragment = new RentalMaterialFragment();
                }
                SwitchTo(rentalFragment);
                break;

            default:
                return;
            }
            var item = drawerMenu.Menu.GetItem(position);

            if (item != null)
            {
                item.SetChecked(true);
            }
            drawer.CloseDrawers();
        }