|
| 1 | +<Page |
| 2 | + x:Class="Richasy.Bili.App.Pages.PopularPage" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:controls="using:Richasy.Bili.App.Controls" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:loc="using:Richasy.Bili.Locator.Uwp" |
| 8 | + xmlns:local="using:Richasy.Bili.App.Pages" |
| 9 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 10 | + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" |
| 11 | + xmlns:uwp="using:Richasy.Bili.ViewModels.Uwp" |
| 12 | + mc:Ignorable="d"> |
| 13 | + |
| 14 | + <Grid> |
| 15 | + <VisualStateManager.VisualStateGroups> |
| 16 | + <VisualStateGroup x:Name="Common"> |
| 17 | + <VisualState x:Name="WideState"> |
| 18 | + <VisualState.StateTriggers> |
| 19 | + <AdaptiveTrigger MinWindowWidth="{StaticResource CompactModeThresholdWidth}" /> |
| 20 | + </VisualState.StateTriggers> |
| 21 | + </VisualState> |
| 22 | + <VisualState x:Name="NarrowState"> |
| 23 | + <VisualState.StateTriggers> |
| 24 | + <AdaptiveTrigger MinWindowWidth="0" /> |
| 25 | + </VisualState.StateTriggers> |
| 26 | + <VisualState.Setters> |
| 27 | + <Setter Target="ContentScrollViewer.Padding" Value="{StaticResource NarrowContainerPadding}" /> |
| 28 | + <Setter Target="VideoView.ItemOrientation" Value="Horizontal" /> |
| 29 | + </VisualState.Setters> |
| 30 | + </VisualState> |
| 31 | + </VisualStateGroup> |
| 32 | + </VisualStateManager.VisualStateGroups> |
| 33 | + <muxc:RefreshContainer RefreshRequested="OnRefreshRequestedAsync"> |
| 34 | + <ScrollViewer |
| 35 | + x:Name="ContentScrollViewer" |
| 36 | + Padding="{StaticResource DefaultContainerPadding}" |
| 37 | + HorizontalScrollMode="Disabled" |
| 38 | + VerticalScrollBarVisibility="Auto"> |
| 39 | + <controls:VideoView |
| 40 | + x:Name="VideoView" |
| 41 | + Margin="0,0,0,12" |
| 42 | + HeaderVisibility="Collapsed" |
| 43 | + ItemsSource="{x:Bind ViewModel.VideoCollection}" |
| 44 | + RequestLoadMore="OnVideoViewRequestLoadMoreAsync"> |
| 45 | + <controls:VideoView.ItemTemplate> |
| 46 | + <DataTemplate x:DataType="uwp:VideoViewModel"> |
| 47 | + <controls:VideoItem |
| 48 | + AdditionalOverlayContentVisibility="{x:Bind AdditionalText, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}" |
| 49 | + IsShowAvatar="False" |
| 50 | + IsShowDanmakuCount="{x:Bind DanmakuCount, Mode=OneWay, Converter={StaticResource ObjectToBoolConverter}}" |
| 51 | + IsShowLikeCount="{x:Bind LikeCount, Mode=OneWay, Converter={StaticResource ObjectToBoolConverter}}" |
| 52 | + IsShowPlayCount="True" |
| 53 | + ViewModel="{x:Bind Mode=OneWay}"> |
| 54 | + <controls:VideoItem.AdditionalOverlayContent> |
| 55 | + <Grid |
| 56 | + Padding="8,4" |
| 57 | + HorizontalAlignment="Left" |
| 58 | + Background="{ThemeResource AccentMaskAcrylicBrush}" |
| 59 | + CornerRadius="{StaticResource ControlCornerRadius}"> |
| 60 | + <TextBlock |
| 61 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 62 | + Foreground="{ThemeResource TextOnAccentFillColorPrimaryBrush}" |
| 63 | + Text="{x:Bind AdditionalText, Mode=OneWay}" /> |
| 64 | + </Grid> |
| 65 | + </controls:VideoItem.AdditionalOverlayContent> |
| 66 | + </controls:VideoItem> |
| 67 | + </DataTemplate> |
| 68 | + </controls:VideoView.ItemTemplate> |
| 69 | + </controls:VideoView> |
| 70 | + </ScrollViewer> |
| 71 | + </muxc:RefreshContainer> |
| 72 | + |
| 73 | + <muxc:ProgressRing Style="{StaticResource PageProgressRingStyle}" IsActive="{x:Bind ViewModel.IsInitializeLoading, Mode=OneWay}" /> |
| 74 | + <muxc:ProgressBar |
| 75 | + HorizontalAlignment="Stretch" |
| 76 | + VerticalAlignment="Bottom" |
| 77 | + IsIndeterminate="True" |
| 78 | + Visibility="{x:Bind ViewModel.IsDeltaLoading, Mode=OneWay}" /> |
| 79 | + |
| 80 | + <controls:ErrorPanel |
| 81 | + x:Name="ErrorPanel" |
| 82 | + HorizontalAlignment="Center" |
| 83 | + VerticalAlignment="Center" |
| 84 | + ActionButtonClick="OnRefreshButtonClickAsync" |
| 85 | + ActionContent="{loc:LocaleLocator Name=Refresh}" |
| 86 | + Text="{x:Bind ViewModel.ErrorText, Mode=OneWay}" |
| 87 | + Visibility="{x:Bind ViewModel.IsError, Mode=OneWay}" /> |
| 88 | + </Grid> |
| 89 | +</Page> |
0 commit comments