Ejemplo n.º 1
0
        private void ListItemClicked(int position)
        {
            Fragment fragment = null;

            switch (position)
            {
            case 0:
                fragment = new HouseFragment();
                break;

            case 1:
                fragment = new RoomFragment();
                break;

            case 2:
                fragment = new DeviceFragment();
                break;
                //case 3:
                //    fragment = new UserListFragment();
                //    break;
            }

            var ft = FragmentManager.BeginTransaction();

            ft.AddToBackStack(null);
            ft.Replace(Resource.Id.HomeFrameLayout, fragment);
            ft.Commit();
        }
Ejemplo n.º 2
0
        private void GrdHouse_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            //var details = FragmentManager.FindFragmentById(Resource.Id.HomeFrameLayout) as HouseFragment;
            //if (details == null )
            //{

            // Make new fragment to show this selection.

            // Execute a transaction, replacing any existing
            // fragment with this one inside the frame.


            //}

            string houseId = e.View.FindViewById <TextView>(Resource.Id.txtHouseId).Text;
            //string houseName = lstHouse[e.Position].name;

            //var roomActivity = new Intent(Activity, typeof(RoomActivity));
            //roomActivity.PutExtra("houseId", houseId);
            //roomActivity.PutExtra("houseName", houseName);

            //StartActivity(roomActivity);

            RoomFragment fragment = new RoomFragment(houseId);
            var          ft       = FragmentManager.BeginTransaction();

            ft.Replace(Resource.Id.HomeFrameLayout, fragment);
            ft.SetTransition(FragmentTransit.EnterMask);
            ft.Commit();
        }