Exemplo n.º 1
0
        private void InitializeDefaultProperties()
        {
            _originalCollection  = new List <FavoritedAnime>();
            _settingsPreferences = App.liteDB.GetCollection <SettingsPreferences>().FindById(0);


            ResetSearchConfig(_settingsPreferences.ShowNSFW, AnimeSearchSortable.Score, SortDirection.Descending);

            IsSearchVisible = false;

            Animes = new ObservableRangeCollection <FavoritedAnime>();

            SelectionModeCommand = new magno.Command(OnSelectionMode);
            AddToFavoriteCommand = new magno.AsyncCommand(OnAddToFavorite);
            ClearTextCommand     = new magno.Command(OnClearText);
            SearchCommand        = new magno.AsyncCommand(OnSearch);
            OpenSearchCommand    = new magno.Command(OnOpenSearch);
            OpenAnimeCommand     = new magno.AsyncCommand(OnOpenAnime);
            LoadMoreCommand      = new magno.AsyncCommand(OnLoadMore);
            ObjectCheckedCommand = new magno.Command <ICheckableObject>(OnObjectChecked);
            ApplyFilterCommand   = new magno.AsyncCommand(OnApplyFilter);
            ResetFilterCommand   = new magno.AsyncCommand(OnResetFilter);
            BackButtonCommand    = new magno.AsyncCommand <CatalogueView>(OnBackButton);
            ChangeSeasonCommand  = new magno.AsyncCommand(OnChangeSeason);
        }
Exemplo n.º 2
0
        public FavoriteAnimeViewModel()
        {
            GroupedFavoriteByWeekList = new ObservableRangeCollection <GroupedFavoriteAnimeByWeekDay>();

            SearchCommand               = new magno.AsyncCommand(OnSearch);
            ClearTextCommand            = new magno.Command(OnClearText);
            DeleteFavoriteCommand       = new magno.AsyncCommand(OnDeleteFavoriteCommand);
            ArchiveFavoriteCommand      = new magno.AsyncCommand(OnArchiveFavorite);
            ClearAllCommand             = new magno.AsyncCommand(OnClearAll);
            SelectionModeCommand        = new magno.Command(OnSelectionMode);
            OpenAnimeCommand            = new magno.AsyncCommand(OnOpenAnime);
            ObjectCheckedCommand        = new magno.Command <ICheckableObject>(OnObjectChecked);
            ApplyFilterCommand          = new magno.AsyncCommand(OnApplyFilter);
            ResetFilterCommand          = new magno.Command(OnResetFilter);
            SwitchCommand               = new Xamarin.Forms.Command <FavoritedAnime>(OnSwitch);
            StepperCommand              = new Xamarin.Forms.Command <FavoritedAnime>(OnStepper);
            UpdateFavoriteAnimesCommand = new AsyncCommand(OnUpdateAnimes);
        }