From 7b5b7de1fb851c949029b762788572eb11d3b099 Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Sun, 27 Feb 2022 23:18:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=AF=BC=E8=88=AA=E4=BB=8E?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E7=BD=91=E9=A1=B5=E6=94=B9=E4=B8=BA=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/PageViewModels/ChannelMedia.cs | 17 ++++++++++++++--- .../PageViewModels/PublicationMedia.cs | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/DownKyi/ViewModels/PageViewModels/ChannelMedia.cs b/DownKyi/ViewModels/PageViewModels/ChannelMedia.cs index a6bcc8f..6bcf0ea 100644 --- a/DownKyi/ViewModels/PageViewModels/ChannelMedia.cs +++ b/DownKyi/ViewModels/PageViewModels/ChannelMedia.cs @@ -1,4 +1,7 @@ -using Prism.Commands; +using DownKyi.Core.BiliApi.BiliUtils; +using DownKyi.Utils; +using Prism.Commands; +using Prism.Events; using Prism.Mvvm; using System.Windows.Media.Imaging; @@ -6,6 +9,13 @@ namespace DownKyi.ViewModels.PageViewModels { public class ChannelMedia : BindableBase { + protected readonly IEventAggregator eventAggregator; + + public ChannelMedia(IEventAggregator eventAggregator) + { + this.eventAggregator = eventAggregator; + } + public long Avid { get; set; } public string Bvid { get; set; } @@ -63,8 +73,9 @@ namespace DownKyi.ViewModels.PageViewModels { if (!(parameter is string tag)) { return; } - string url = "https://www.bilibili.com/video/" + tag; - System.Diagnostics.Process.Start(url); + NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, tag, $"{ParseEntrance.VideoUrl}{Bvid}"); + //string url = "https://www.bilibili.com/video/" + tag; + //System.Diagnostics.Process.Start(url); } } diff --git a/DownKyi/ViewModels/PageViewModels/PublicationMedia.cs b/DownKyi/ViewModels/PageViewModels/PublicationMedia.cs index f7c2636..6d78abb 100644 --- a/DownKyi/ViewModels/PageViewModels/PublicationMedia.cs +++ b/DownKyi/ViewModels/PageViewModels/PublicationMedia.cs @@ -1,4 +1,7 @@ -using Prism.Commands; +using DownKyi.Core.BiliApi.BiliUtils; +using DownKyi.Utils; +using Prism.Commands; +using Prism.Events; using Prism.Mvvm; using System.Windows.Media.Imaging; @@ -6,6 +9,13 @@ namespace DownKyi.ViewModels.PageViewModels { public class PublicationMedia : BindableBase { + protected readonly IEventAggregator eventAggregator; + + public PublicationMedia(IEventAggregator eventAggregator) + { + this.eventAggregator = eventAggregator; + } + public long Avid { get; set; } public string Bvid { get; set; } @@ -63,8 +73,9 @@ namespace DownKyi.ViewModels.PageViewModels { if (!(parameter is string tag)) { return; } - string url = "https://www.bilibili.com/video/" + tag; - System.Diagnostics.Process.Start(url); + NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, tag, $"{ParseEntrance.VideoUrl}{Bvid}"); + //string url = "https://www.bilibili.com/video/" + tag; + //System.Diagnostics.Process.Start(url); } }