From 012cb42042f54bc4474e2fe5ff3b8f081df17733 Mon Sep 17 00:00:00 2001 From: croire <1432593898@qq.com> Date: Sun, 6 Mar 2022 21:56:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=91=E7=9A=84=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E5=A4=B9=E5=92=8C=E6=88=91=E7=9A=84=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewMyBangumiFollowViewModel.cs | 5 ++ .../ViewModels/ViewMyFavoritesViewModel.cs | 13 +++++ DownKyi/Views/ViewMyFavorites.xaml | 48 ++++++++++--------- 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/DownKyi/ViewModels/ViewMyBangumiFollowViewModel.cs b/DownKyi/ViewModels/ViewMyBangumiFollowViewModel.cs index e4e0058..e082410 100644 --- a/DownKyi/ViewModels/ViewMyBangumiFollowViewModel.cs +++ b/DownKyi/ViewModels/ViewMyBangumiFollowViewModel.cs @@ -190,6 +190,9 @@ namespace DownKyi.ViewModels { if (!(parameter is TabHeader tabHeader)) { return; } + // 顶部tab点击后,隐藏Content + ContentVisibility = Visibility.Collapsed; + // 页面选择 Pager = new CustomPagerViewModel(1, 1); Pager.CurrentChanged += OnCurrentChanged_Pager; @@ -354,6 +357,8 @@ namespace DownKyi.ViewModels private async void UpdateBangumiMediaList(int current) { Medias.Clear(); + IsSelectAll = false; + LoadingVisibility = Visibility.Visible; NoDataVisibility = Visibility.Collapsed; diff --git a/DownKyi/ViewModels/ViewMyFavoritesViewModel.cs b/DownKyi/ViewModels/ViewMyFavoritesViewModel.cs index 4a8fd90..ce93ace 100644 --- a/DownKyi/ViewModels/ViewMyFavoritesViewModel.cs +++ b/DownKyi/ViewModels/ViewMyFavoritesViewModel.cs @@ -80,6 +80,14 @@ namespace DownKyi.ViewModels set => SetProperty(ref mediaLoading, value); } + private Visibility mediaContentVisibility; + public Visibility MediaContentVisibility + { + get => mediaContentVisibility; + set => SetProperty(ref mediaContentVisibility, value); + } + + private Visibility mediaLoadingVisibility; public Visibility MediaLoadingVisibility { @@ -211,6 +219,9 @@ namespace DownKyi.ViewModels { if (!(parameter is TabHeader tabHeader)) { return; } + // tab点击后,隐藏MediaContent + MediaContentVisibility = Visibility.Collapsed; + // 页面选择 Pager = new CustomPagerViewModel(1, (int)Math.Ceiling(double.Parse(tabHeader.SubTitle) / VideoNumberInPage)); Pager.CurrentChanged += OnCurrentChanged_Pager; @@ -393,11 +404,13 @@ namespace DownKyi.ViewModels List medias = FavoritesResource.GetFavoritesMedia(tab.Id, current, VideoNumberInPage); if (medias == null || medias.Count == 0) { + MediaContentVisibility = Visibility.Visible; MediaLoadingVisibility = Visibility.Collapsed; MediaNoDataVisibility = Visibility.Visible; return; } + MediaContentVisibility = Visibility.Visible; MediaLoadingVisibility = Visibility.Collapsed; MediaNoDataVisibility = Visibility.Collapsed; diff --git a/DownKyi/Views/ViewMyFavorites.xaml b/DownKyi/Views/ViewMyFavorites.xaml index 58c4aeb..97e73df 100644 --- a/DownKyi/Views/ViewMyFavorites.xaml +++ b/DownKyi/Views/ViewMyFavorites.xaml @@ -221,7 +221,10 @@ - + @@ -268,27 +271,6 @@ - - - - - - - - @@ -340,6 +322,28 @@ Style="{StaticResource BtnStyle}" /> + + + + + + + + +