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); } }