コード例 #1
0
        private void SetupMenuItem(NavigableScreen activity)
        {
            NavigationItem itemToAdd;

            switch (activity)
            {
            case NavigableScreen.Main:
                itemToAdd = new NavigationItem()
                {
                    MenuName = "Hoofdmenu", Icon = Resource.Drawable.ic_home_white_48dp
                };
                break;

            case NavigableScreen.Determination:
                itemToAdd = new NavigationItem()
                {
                    MenuName = "Determinatie", Icon = Resource.Drawable.ic_search_white_48dp
                };
                break;

            case NavigableScreen.SpeciesList:
                itemToAdd = new NavigationItem()
                {
                    MenuName = "Soortenlijst", Icon = Resource.Drawable.ic_list_white_48dp
                };
                break;

            case NavigableScreen.Info:
                itemToAdd = new NavigationItem()
                {
                    MenuName = "Info", Icon = Resource.Drawable.ic_info_outline_white_48dp
                };
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(activity), activity, null);
            }
            myDrawerList.Add(itemToAdd);
        }
コード例 #2
0
        public void NavigateTo(NavigableScreen screen)
        {
            switch (screen)
            {
            case NavigableScreen.Main:
                StartActivity(typeof(MainActivity));
                break;

            case NavigableScreen.Determination:
                StartActivity(typeof(DeterminationActivity));
                break;

            case NavigableScreen.SpeciesList:
                StartActivity(typeof(SpeciesListActivity));
                break;

            case NavigableScreen.Info:
                StartActivity(typeof(InfoActivity));
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(screen), screen, null);
            }
        }