public async Task ShowAsync() { this.Visibility = Visibility.Visible; CurrentlyAccessedFolder = ImageNavigationHelper.ContainingFolder; CurrentlyDisplayedImageItem = ImageNavigationHelper.SelectedImage; ImageData = CurrentlyAccessedFolder.GetRawImageItems(); CurrentIndexInImageData = ImageData.IndexOf(CurrentlyDisplayedImageItem); UpdateArrowsVisibility(); await CurrentlyDisplayedImageItem.ToImageAsync(); }
private async Task UpdateImageToIndex(int index, CancellationToken ct = new CancellationToken()) { if (ct.IsCancellationRequested) { return; } var oldImage = CurrentlyDisplayedImageItem; CurrentlyDisplayedImageItem = ImageData[CurrentIndexInImageData]; if (ct.IsCancellationRequested) { return; } await CurrentlyDisplayedImageItem?.ToImageAsync(ct); await oldImage?.ToThumbnailAsync(); }