From c986e2859d858b3b976b43183bdce0a6fbd70d77 Mon Sep 17 00:00:00 2001 From: Miaoyww Date: Tue, 23 Jul 2024 01:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=8E=A8=E8=8D=90=E6=AD=8C?= =?UTF-8?q?=E5=8D=95=E5=8D=A1=E7=89=87=E3=80=81=E7=94=B5=E5=8F=B0=E5=8D=A1?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NonsPlayer/ViewModels/ExploreViewModel.cs | 14 ++++++++------ NonsPlayer/Views/Pages/ExplorePage.xaml | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/NonsPlayer/ViewModels/ExploreViewModel.cs b/NonsPlayer/ViewModels/ExploreViewModel.cs index 00a6b6b..e1953f0 100644 --- a/NonsPlayer/ViewModels/ExploreViewModel.cs +++ b/NonsPlayer/ViewModels/ExploreViewModel.cs @@ -8,17 +8,19 @@ namespace NonsPlayer.ViewModels; public partial class ExploreViewModel : ObservableRecipient, INavigationAware { - [ObservableProperty] private IPlaylist dailyRecommendedPlaylist; - public ExploreViewModel() - { - } + [ObservableProperty] private IMusic[] dailyRecommendedPlaylist; - public void OnNavigatedTo(object parameter) + public async void OnNavigatedTo(object parameter) { var adapters = AdapterService.Instance.GetAdaptersByType(ISubAdapterEnum.Common); foreach (var item in adapters) { - item.Common.GetRecommendedPlaylistAsync(10); + var music = await item.Common.GetDailyRecommended(); + if (music != null) + { + DailyRecommendedPlaylist = music; + break; + } } } diff --git a/NonsPlayer/Views/Pages/ExplorePage.xaml b/NonsPlayer/Views/Pages/ExplorePage.xaml index e0a0205..5e1b488 100644 --- a/NonsPlayer/Views/Pages/ExplorePage.xaml +++ b/NonsPlayer/Views/Pages/ExplorePage.xaml @@ -4,11 +4,28 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:views="using:NonsPlayer.Components.Views" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + \ No newline at end of file