优化我的收藏夹和我的订阅页面UI

croire 3 years ago
parent d0b2f577c8
commit 012cb42042

@ -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;

@ -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<Core.BiliApi.Favorites.Models.FavoritesMedia> 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;

@ -221,7 +221,10 @@
</i:Interaction.Triggers>
</ListBox>
<Grid Name="nameMediaPanel" Grid.Column="1">
<Grid
Name="nameMediaPanel"
Grid.Column="1"
Visibility="{Binding MediaContentVisibility}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="1" />
@ -268,27 +271,6 @@
</ListBox.Style>
</ListBox>
<!-- 加载gif -->
<StackPanel
Grid.Row="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="{Binding MediaLoadingVisibility}">
<ContentControl
Width="40"
Height="40"
Content="{Binding MediaLoading}" />
</StackPanel>
<!-- 没有数据提示 -->
<Image
Grid.Row="0"
Width="256"
Height="256"
Source="/DownKyi;component/Resources/no-data.png"
Visibility="{Binding MediaNoDataVisibility}" />
<TextBlock Grid.Row="1" Background="{DynamicResource BrushBorder}" />
<Grid Grid.Row="2">
@ -340,6 +322,28 @@
Style="{StaticResource BtnStyle}" />
</Grid>
</Grid>
<!-- 加载gif -->
<StackPanel
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="{Binding MediaLoadingVisibility}">
<ContentControl
Width="40"
Height="40"
Content="{Binding MediaLoading}" />
</StackPanel>
<!-- 没有数据提示 -->
<Image
Grid.Column="1"
Width="256"
Height="256"
Source="/DownKyi;component/Resources/no-data.png"
Visibility="{Binding MediaNoDataVisibility}" />
</Grid>
<!-- 加载gif -->

Loading…
Cancel
Save