MainPage.xaml.cs 4.22 KB
Newer Older
Mattia's avatar
Mattia committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SampleApp.ViewModels;
using SampleApp.Views;
using Xamarin.Forms;

namespace SampleApp
{
    // Learn more about making custom code visible in the Xamarin.Forms previewer
    // by visiting https://aka.ms/xamarinforms-previewer
    [DesignTimeVisible(false)]
    public partial class MainPage : ContentPage
    {

        public MainPage()
        {
            InitializeComponent();
            BindingContext = new ListPageViewModel();
            
            
        }

        private async void OnListViewItemTapped(object sender, ItemTappedEventArgs e)
        {
            var details = e.Item as APIFunctionality;

            if (sender is ListView lv) lv.SelectedItem = null;

            switch (details.Name)
            {
                case "1":
                    await Navigation.PushAsync(new Functionality1());
                    break;
                case "2":
                    await Navigation.PushAsync(new Functionality2());
                    break;
                case "3":
                    await Navigation.PushAsync(new Functionality3());
                    break;
                case "4":
                    await Navigation.PushAsync(new Functionality4());
                    break;
                case "5":
                    await Navigation.PushAsync(new Functionality5());
                    break;
                case "6":
                    await Navigation.PushAsync(new Functionality6());
                    break;
                case "7":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality7());
                    break;
                case "8":
                    await Navigation.PushAsync(new Functionality8());
                    break;
                case "9":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality9());
                    break;
                case "10":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality10());
                    break;
                case "11":
                    await Navigation.PushAsync(new Functionality11());
                    break;
                case "12":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality12());
                    break;
                case "13":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality13());
                    break;
                case "14":
                    await Navigation.PushAsync(new Functionality14());
                    break;
                case "15":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality15());
                    break;
                case "16":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality16());
                    break;
                case "17":
                    await Navigation.PushAsync(new Functionality17());
                    break;
                case "18":
                    await Navigation.PushAsync(new Functionality18());
                    break;
                case "19":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality19());
                    break;
                case "20":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality20());
                    break;
                case "21":
                    await Navigation.PushAsync(new Functionality21());
                    break;
                case "22":
                    await Navigation.PushAsync(new Functionality22());
                    break;
                case "23":
                    await Navigation.PushAsync(new Functionality23());
                    break;
                case "24":
                    // TO IMPLEMENT
                    //await Navigation.PushAsync(new Functionality24());
                    break;
            }
            
            
            
        }
    }
}