private async void SpotlightContainer_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Notice("正在搜索Pixivision..."); var article = sender.GetDataContext <SpotlightArticle>(); var tasks = (await PixivClient.Instance.GetArticleWorks(article.Id.ToString())).Select(PixivHelper.IllustrationInfo).Where(i => i != null); var result = await Task.WhenAll(tasks); IllustViewer.Show(result[0], result); }
private async void TryQuerySingle(string illustId) { if (!int.TryParse(illustId, out _)) { Notice(Externally.InputIllegal("单个作品")); return; } try { IllustViewer.Show(await PixivHelper.IllustrationInfo(illustId)); } catch (ApiException exception) { if (exception.StatusCode == HttpStatusCode.NotFound || exception.StatusCode == HttpStatusCode.BadRequest) { Notice(Externally.IdDoNotExists); } else { throw; } } }
private void IllustrationContainer_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { IllustViewer.Show(sender.GetDataContext <Illustration>(), ImageListView.ItemsSource as IEnumerable <Illustration>); }
private void ToDownloadListViewItem_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) { IllustViewer.Show(sender.GetDataContext <Illustration>(), DownloadList.ToDownloadList); }