public void TabSelected(View p0)
        {
            var txt = p0 as TextView;

            txt.Alpha = 1f;
            _currentFragment?.DetachBindings();
            switch ((int)p0.Tag)
            {
            case 0:
                _animeSearchPageFragment.NavigatedTo();
                _currentFragment = _animeSearchPageFragment;
                ShowSearchStuff();
                ViewModelLocator.SearchPage.Init(new SearchPageNavigationArgs {
                    Query = ViewModelLocator.GeneralMain.CurrentSearchQuery
                });
                break;

            case 1:
                _mangaSearchPageFragment.NavigatedTo();
                _currentFragment = _mangaSearchPageFragment;
                ShowSearchStuff();
                ViewModelLocator.SearchPage.Init(new SearchPageNavigationArgs {
                    Anime = false, Query = ViewModelLocator.GeneralMain.CurrentSearchQuery
                });
                break;

            case 2:
                _currentFragment = _characterSearchPageFragment;
                ShowSearchStuff();
                ViewModelLocator.CharacterSearch.Init(new SearchPageNavArgsBase());
                _currentFragment?.ReattachBindings();
                break;

            case 3:
                _currentFragment = _genresSearchPageFragment;
                ViewModelLocator.GeneralMain.SearchToggleLock = false;
                ViewModelLocator.GeneralMain.HideSearchStuff();
                ViewModelLocator.GeneralMain.CurrentStatus = "Anime by Genre";
                ViewModelLocator.SearchPage.Init(new SearchPageNavigationArgs {
                    ByGenre = true
                });
                _currentFragment?.ReattachBindings();
                break;

            case 4:
                ViewModelLocator.GeneralMain.HideSearchStuff();
                ViewModelLocator.GeneralMain.SearchToggleLock = false;
                ViewModelLocator.GeneralMain.CurrentStatus    = "Anime by Studio";
                _currentFragment = _studiosSearchPageFragment;
                ViewModelLocator.SearchPage.Init(new SearchPageNavigationArgs {
                    ByStudio = true
                });
                _currentFragment?.ReattachBindings();
                break;
            }
        }
示例#2
0
        public void TabSelected(View p0)
        {
            var txt = p0 as TextView;

            txt.Alpha = 1f;
            _currentFragment?.DetachBindings();
            switch ((int)p0.Tag)
            {
            case 0:
                _currentFragment = _articlesFragment;
                ViewModelLocator.MalArticles.Init(MalArticlesPageNavigationArgs.Articles);
                break;

            case 1:
                _currentFragment = _newsFragment;
                ViewModelLocator.MalArticles.Init(MalArticlesPageNavigationArgs.News);
                break;
            }
            _currentFragment?.ReattachBindings();
        }