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

croire 3 years ago
parent d0b2f577c8
commit 012cb42042

@ -190,6 +190,9 @@ namespace DownKyi.ViewModels
{ {
if (!(parameter is TabHeader tabHeader)) { return; } if (!(parameter is TabHeader tabHeader)) { return; }
// 顶部tab点击后隐藏Content
ContentVisibility = Visibility.Collapsed;
// 页面选择 // 页面选择
Pager = new CustomPagerViewModel(1, 1); Pager = new CustomPagerViewModel(1, 1);
Pager.CurrentChanged += OnCurrentChanged_Pager; Pager.CurrentChanged += OnCurrentChanged_Pager;
@ -354,6 +357,8 @@ namespace DownKyi.ViewModels
private async void UpdateBangumiMediaList(int current) private async void UpdateBangumiMediaList(int current)
{ {
Medias.Clear(); Medias.Clear();
IsSelectAll = false;
LoadingVisibility = Visibility.Visible; LoadingVisibility = Visibility.Visible;
NoDataVisibility = Visibility.Collapsed; NoDataVisibility = Visibility.Collapsed;

@ -80,6 +80,14 @@ namespace DownKyi.ViewModels
set => SetProperty(ref mediaLoading, value); set => SetProperty(ref mediaLoading, value);
} }
private Visibility mediaContentVisibility;
public Visibility MediaContentVisibility
{
get => mediaContentVisibility;
set => SetProperty(ref mediaContentVisibility, value);
}
private Visibility mediaLoadingVisibility; private Visibility mediaLoadingVisibility;
public Visibility MediaLoadingVisibility public Visibility MediaLoadingVisibility
{ {
@ -211,6 +219,9 @@ namespace DownKyi.ViewModels
{ {
if (!(parameter is TabHeader tabHeader)) { return; } if (!(parameter is TabHeader tabHeader)) { return; }
// tab点击后隐藏MediaContent
MediaContentVisibility = Visibility.Collapsed;
// 页面选择 // 页面选择
Pager = new CustomPagerViewModel(1, (int)Math.Ceiling(double.Parse(tabHeader.SubTitle) / VideoNumberInPage)); Pager = new CustomPagerViewModel(1, (int)Math.Ceiling(double.Parse(tabHeader.SubTitle) / VideoNumberInPage));
Pager.CurrentChanged += OnCurrentChanged_Pager; Pager.CurrentChanged += OnCurrentChanged_Pager;
@ -393,11 +404,13 @@ namespace DownKyi.ViewModels
List<Core.BiliApi.Favorites.Models.FavoritesMedia> medias = FavoritesResource.GetFavoritesMedia(tab.Id, current, VideoNumberInPage); List<Core.BiliApi.Favorites.Models.FavoritesMedia> medias = FavoritesResource.GetFavoritesMedia(tab.Id, current, VideoNumberInPage);
if (medias == null || medias.Count == 0) if (medias == null || medias.Count == 0)
{ {
MediaContentVisibility = Visibility.Visible;
MediaLoadingVisibility = Visibility.Collapsed; MediaLoadingVisibility = Visibility.Collapsed;
MediaNoDataVisibility = Visibility.Visible; MediaNoDataVisibility = Visibility.Visible;
return; return;
} }
MediaContentVisibility = Visibility.Visible;
MediaLoadingVisibility = Visibility.Collapsed; MediaLoadingVisibility = Visibility.Collapsed;
MediaNoDataVisibility = Visibility.Collapsed; MediaNoDataVisibility = Visibility.Collapsed;

@ -221,7 +221,10 @@
</i:Interaction.Triggers> </i:Interaction.Triggers>
</ListBox> </ListBox>
<Grid Name="nameMediaPanel" Grid.Column="1"> <Grid
Name="nameMediaPanel"
Grid.Column="1"
Visibility="{Binding MediaContentVisibility}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition Height="1" /> <RowDefinition Height="1" />
@ -268,27 +271,6 @@
</ListBox.Style> </ListBox.Style>
</ListBox> </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}" /> <TextBlock Grid.Row="1" Background="{DynamicResource BrushBorder}" />
<Grid Grid.Row="2"> <Grid Grid.Row="2">
@ -340,6 +322,28 @@
Style="{StaticResource BtnStyle}" /> Style="{StaticResource BtnStyle}" />
</Grid> </Grid>
</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> </Grid>
<!-- 加载gif --> <!-- 加载gif -->

Loading…
Cancel
Save