private void UpdateViewCollection() { DispatcherTimer dispatcherTimer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(5000) }; dispatcherTimer.Tick += (s, e) => { dispatcherTimer.Stop(); if (VideoItemViewCollection == null) { return; } BackgroundService.Execute(() => { lock (Padlock) { this.IsLoading = true; LoaderCompletion.FinishCollectionLoadProcess(VideoItemViewCollection, FilePageDispatcher); } }, String.Format("Checking and updating files info in {0}", CurrentVideoFolder.Name), () => { this.IsLoading = false; }); }; dispatcherTimer.Start(); }
private void InitFinishCollection() { DispatcherService.ExecuteTimerAction(() => { BackgroundService.Execute(() => { LoaderCompletion.FinishCollectionLoadProcess(PlayListCollection, null); }, "Getting playlist metadata...", () => { }); }, 5000); }
private void UpdateViewCollection() { if (SearchResults.Count == 0) { return; } BackgroundService.Execute(() => { //this.IsLoading = true; LoaderCompletion.FinishCollectionLoadProcess(SearchResults, SearchPageDispatcher); }, String.Format("Updating files from search {0} result(s). ", ResultText)); }
private void StartFileLoading() { if (UsbDrives != null && UsbDrives.Count == 0) { return; } var task = BackgroundService.Execute(() => { LoaderCompletion.FinishCollectionLoadProcess(UsbDrives, true); FileLoader.InitGetAllFiles(UsbDrives); }, "Loading your movie folders!.", () => { CommandManager.InvalidateRequerySuggested(); RaisePropertyChanged(() => this.UsbDrives); }); }
private void NavigationService_LoadCompleted(object sender, NavigationEventArgs e) { VideoFolder videoFolder = (VideoFolder)e.ExtraData; HamburgerMenuIcon = new HamburgerMenuIconItem() { Label = videoFolder.Name, Icon = new PackIconMaterial() { Kind = PackIconMaterialKind.FolderOpen } }; BackgroundService.Execute(() => { this.IsLoading = true; GetVideoFolder(videoFolder); }, String.Format("Updating files in {0}", videoFolder.Name), () => { this.IsLoading = false; OnDataLoaded(videoFolder); }); navigationService.LoadCompleted -= NavigationService_LoadCompleted; }