상속: SearchPageNavArgsBase
예제 #1
0
 private SearchPageFragment(SearchPageNavigationArgs args)
 {
     _args = args;
 }
예제 #2
0
 public static SearchPageFragment BuildInstance(SearchPageNavigationArgs args)
 {
     return new SearchPageFragment(args); //just so we follow the pattern
 }
예제 #3
0
        public void Init(SearchPageNavigationArgs args)
        {
            PrevArgs = args;
            if (args.ByGenre || args.ByStudio)
            {
                PrevQuery = null;
                EmptyNoticeVisibility = false;
                IsFirstVisitGridVisible = false;
                GenreSelectionGridVisibility = true;
                DirectQueryInputVisibility = false;

                if (args.ByGenre)
                {
                    AvailableSelectionChoices = Enum.GetValues(typeof(AnimeGenres)).Cast<Enum>().OrderBy(val => val.ToString()).ToList();
                }
                else
                {
                    AvailableSelectionChoices = Enum.GetValues(typeof(AnimeStudios)).Cast<Enum>().OrderBy(val => val.ToString()).ToList();
                }

                return;
            }
            else
            {
                GenreSelectionGridVisibility = false;
            }

            if (_animeSearch != args.Anime)
                PrevQuery = null;
            if(!_queryHandler)
                ViewModelLocator.GeneralMain.OnSearchQuerySubmitted += SubmitQuery;
            _queryHandler = true;
            _currrentFilter = null;
            _animeSearch = args.Anime;
            EmptyNoticeVisibility = false;
            IsFirstVisitGridVisible = true;
            if (args.DisplayMode == SearchPageDisplayModes.Off)
            {
                ViewModelLocator.NavMgr.ResetOffBackNav();
                DirectQueryInputVisibility = true;
                if (_queryHandler)
                {
                    ViewModelLocator.GeneralMain.OnSearchQuerySubmitted -= SubmitQuery;
                    _queryHandler = false;
                }
            }
            else
            {
                DirectQueryInputVisibility = false;
            }

            if (!string.IsNullOrWhiteSpace(args.Query) && args.DisplayMode == SearchPageDisplayModes.Main)
            {
                ViewModelLocator.GeneralMain.PopulateSearchFilters(_filters);
                SubmitQuery(args.Query);
            }
            else
            {
                _filters.Clear();
                AnimeSearchItemViewModels.Clear();
                IsFirstVisitGridVisible = true;
                ResetQuery();
            }
        }