Exemplo n.º 1
0
 private void SetCurrentFragment()
 {
     switch (_CurrentViewTitle)
     {
         case Resource.String.applicationName :
             _Landing = new LandingFragment(sessionBookingData, workshopBookingData,studentData);
             SetView(Resource.Id.fragmentContainer, _Landing, true);
             break;
         case Resource.String.searchTitle:
             //Fetch workshop data for available workshops
             //FetchAvailableWorkshops();
             _Search = new SearchWorkshopsFragment(workshopData); 
             SetView(Resource.Id.fragmentContainer, _Search, true);
             break;
         // Future bookings.
         case Resource.String.futureBookingsTitle:
             _Future = new FutureBookingsFragment(sessionBookingData, workshopBookingData, studentData);
             SetView(Resource.Id.fragmentContainer, _Future, true);
             break;
         // Past bookings.
         case Resource.String.pastBookingsTitle:
             _Past = new PastBookingsFragment(sessionBookingData, workshopBookingData, studentData);
             SetView(Resource.Id.fragmentContainer, _Past, true);
             break;
     }
 }
Exemplo n.º 2
0
        private void SetUpMenu()
        {
            _Menu = FindViewById<ListView>(Resource.Id.listMenu);

            _MenuAdapter = ArrayAdapter<string>.CreateFromResource(this, Resource.Array.menu, Resource.Layout.MenuRow);
            _Menu.Adapter = _MenuAdapter;

            _Menu.ItemClick += async (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                switch (e.Position)
                {
                    // Profile/Landing page.
                    case 0:
                        _CurrentViewTitle = Resource.String.applicationName;
                        SetView(Resource.Id.fragmentContainer, _Landing, true);
                        break;
                    // Search workshops.
                    case 1:
                        //Fetch workshop data for available workshops
                        await FetchAvailableWorkshops();
                        _Search = new SearchWorkshopsFragment(workshopData);
                        _CurrentViewTitle = Resource.String.searchTitle;
                        SetView(Resource.Id.fragmentContainer, _Search, true);
                        break;
                    // Future bookings.
                    case 2:
                        _CurrentViewTitle = Resource.String.futureBookingsTitle;
                        SetView(Resource.Id.fragmentContainer, _Future, true);
                        break;
                    // Past bookings.
                    case 3:
                        _CurrentViewTitle = Resource.String.pastBookingsTitle;
                        SetView(Resource.Id.fragmentContainer, _Past, true);
                        break;
                    // Record notes.
                    //case 4:
                    // Settings.
                    //case 5:
                    //    Console.WriteLine("Not implemented");
                    //    break;
                    // Log out.
                    case 4:
                        // {Architecture} Log Out function
                        StartActivity(typeof(LogOnActivity));
                        Finish();
                        break;
                }
            };
        }