protected void NavigateToInfo(MediaToolItem filePath) { if (filePath != null) { NavigationProvider.Navigate(NavigationSource.InfoPage, filePath); } }
protected virtual async void ItemClickExecute(MediaToolItem item) { if (item != null && !item.IsEmpty) { await RecentProvider.Instance.AddToRecentAsync(item); this.NavigateToInfo(item); } }
public async Task DeleteFromRecentAsync(MediaToolItem item) { var items = await this.GetRecentFilesAsync(); if (item != null && items.Count > 0) { items.Remove(item); } this.recentItems = items; await this.WriteToFileAsync(); }
public async Task DeleteFromFavoriteAsync(MediaToolItem item) { var items = await this.GetFavoriteFilesAsync(); if (item != null && items.Count > 0) { items.Remove(item); } this.favoriteItems = items; await this.WriteToFileAsync(); }
public async Task AddToRecentAsync(MediaToolItem item) { var items = await this.GetRecentFilesAsync(); var file = items.FirstOrDefault(x => x.FilePath == item.FilePath); if (file == null) { this.recentItems.Add(item); await this.WriteToFileAsync(); } }
protected override async void ItemClickExecute(MediaToolItem item) { if (item != null && item.IsEmpty) { this.AddFilesExecuteAsync(); } else { await RecentProvider.Instance.AddToRecentAsync(item); this.NavigateToInfo(item); } }