Esempio n. 1
0
 /// <summary>
 /// Xoa thong tin search
 /// </summary>
 private async void ClearSearch()
 {
     IsSearch            = false;
     _currentSearchQuery = string.Empty;
     CurrentPageIndex    = 0;
     await LoadingTheLoaiCommand.Execute();
 }
Esempio n. 2
0
        public MainPageViewModel(INavigationService navService, IDialogService dialogService, ISettingService settingService, IResourceLoader resourceLoader)
        {
            _navService      = navService;
            _dialogService   = dialogService;
            _settingService  = settingService;
            _resourceLoader  = resourceLoader;
            CurrentPageIndex = 1;
            MaxPageIndex     = 2;
            TrangDocTruyen   = Wrapper.SiteTruyen.LuongSonBac;
            TheLoaiDangXem   = Wrapper.TagTruyen.Default;
            GenerateData();
            IsLoading              = false;
            JumpPageCommand        = new DelegateCommand <string>(AddPage);
            LoadingNextPageCommand = new CompositeCommand();
            LoadingNextPageCommand.RegisterCommand(JumpPageCommand);
            LoadingNextPageCommand.RegisterCommand(LoadingTheLoaiCommand);
            LoadingPreviousCommand = new CompositeCommand();
            LoadingPreviousCommand.RegisterCommand(JumpPageCommand);
            LoadingPreviousCommand.RegisterCommand(LoadingTheLoaiCommand);


            NavigateChapterCommand  = new DelegateCommand <object>(NavigateChapter);
            FirstLoadCommand        = new DelegateCommand(FisrtLoad);
            SearchPageCommand       = new DelegateCommand <string>(Search);
            ClearSearchPageCommand  = new DelegateCommand(ClearSearch);
            ChangeSiteTruyenCommand = new DelegateCommand <SiteTruyenVM>(
                async(value) =>
            {
                ChangeSiteTruyen(value);
                await LoadingTheLoaiCommand.Execute();
            });
            ListViewScrollValue = 0;
        }
Esempio n. 3
0
 // load khi lan dau tien xem
 private async void FisrtLoad()
 {
     DanhSachTruyen.Clear();
     if (await _settingService.IsHaveFavorite())
     {
         await LoadingFavorite();
     }
     else
     {
         await LoadingTheLoaiCommand.Execute();
     }
 }