|
| 1 | +<Page |
| 2 | + x:Class="Richasy.Bili.App.Pages.PgcIndexPage" |
| 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" |
| 10 | + xmlns:uwp="using:Richasy.Bili.ViewModels.Uwp" |
| 11 | + mc:Ignorable="d"> |
| 12 | + |
| 13 | + <Page.Resources> |
| 14 | + <DataTemplate x:Key="WideSeasonItemTemplate" x:DataType="uwp:SeasonViewModel"> |
| 15 | + <controls:PgcItem ViewModel="{x:Bind}" /> |
| 16 | + </DataTemplate> |
| 17 | + <DataTemplate x:Key="NarrowSeasonItemTemplate" x:DataType="uwp:SeasonViewModel"> |
| 18 | + <controls:PgcItem |
| 19 | + CoverHeight="140" |
| 20 | + CoverWidth="100" |
| 21 | + TitleRowHeight="28" |
| 22 | + ViewModel="{x:Bind}"> |
| 23 | + <controls:PgcItem.CardStyle> |
| 24 | + <Style TargetType="controls:CardPanel"> |
| 25 | + <Setter Property="IsEnableHoverAnimation" Value="False" /> |
| 26 | + <Setter Property="IsEnableShadow" Value="False" /> |
| 27 | + </Style> |
| 28 | + </controls:PgcItem.CardStyle> |
| 29 | + </controls:PgcItem> |
| 30 | + </DataTemplate> |
| 31 | + </Page.Resources> |
| 32 | + |
| 33 | + <Grid> |
| 34 | + <Grid.RowDefinitions> |
| 35 | + <RowDefinition Height="Auto" /> |
| 36 | + <RowDefinition Height="Auto" /> |
| 37 | + <RowDefinition Height="*" /> |
| 38 | + </Grid.RowDefinitions> |
| 39 | + <VisualStateManager.VisualStateGroups> |
| 40 | + <VisualStateGroup x:Name="Common"> |
| 41 | + <VisualState x:Name="WideState"> |
| 42 | + <VisualState.StateTriggers> |
| 43 | + <AdaptiveTrigger MinWindowWidth="{StaticResource MediumWindowThresholdWidth}" /> |
| 44 | + </VisualState.StateTriggers> |
| 45 | + </VisualState> |
| 46 | + <VisualState x:Name="NarrowState"> |
| 47 | + <VisualState.StateTriggers> |
| 48 | + <AdaptiveTrigger MinWindowWidth="0" /> |
| 49 | + </VisualState.StateTriggers> |
| 50 | + <VisualState.Setters> |
| 51 | + <Setter Target="ContentScrollViewer.Padding" Value="{StaticResource NarrowContainerPadding}" /> |
| 52 | + <Setter Target="FilterContainer.Padding" Value="{StaticResource NarrowContainerPadding}" /> |
| 53 | + <Setter Target="IndexView.ItemOrientation" Value="Horizontal" /> |
| 54 | + <Setter Target="IndexView.ItemTemplate" Value="{StaticResource NarrowSeasonItemTemplate}" /> |
| 55 | + </VisualState.Setters> |
| 56 | + </VisualState> |
| 57 | + </VisualStateGroup> |
| 58 | + </VisualStateManager.VisualStateGroups> |
| 59 | + <TextBlock |
| 60 | + Style="{StaticResource TitleTextBlockStyle}" |
| 61 | + Margin="0,0,0,12" |
| 62 | + HorizontalAlignment="Left" |
| 63 | + TextTrimming="CharacterEllipsis"> |
| 64 | + <Run |
| 65 | + FontWeight="Bold" |
| 66 | + Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" |
| 67 | + Text="{x:Bind ViewModel.PgcName, Mode=OneWay}" /> |
| 68 | + <Run Text="{loc:LocaleLocator Name=Index}" /> |
| 69 | + </TextBlock> |
| 70 | + |
| 71 | + <Grid |
| 72 | + x:Name="FilterContainer" |
| 73 | + Grid.Row="1" |
| 74 | + Padding="{StaticResource DefaultContainerPadding}"> |
| 75 | + <muxc:ItemsRepeater ItemsSource="{x:Bind ViewModel.FilterCollection, Mode=OneWay}"> |
| 76 | + <muxc:ItemsRepeater.Layout> |
| 77 | + <muxc:UniformGridLayout |
| 78 | + ItemsStretch="Fill" |
| 79 | + MinColumnSpacing="12" |
| 80 | + MinItemWidth="120" |
| 81 | + MinRowSpacing="12" /> |
| 82 | + </muxc:ItemsRepeater.Layout> |
| 83 | + <muxc:ItemsRepeater.ItemTemplate> |
| 84 | + <DataTemplate x:DataType="uwp:PgcConditionViewModel"> |
| 85 | + <ComboBox |
| 86 | + HorizontalAlignment="Stretch" |
| 87 | + Header="{x:Bind Name, Mode=OneWay}" |
| 88 | + ItemsSource="{x:Bind ConditionCollection, Mode=OneWay}" |
| 89 | + SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}" |
| 90 | + SelectionChanged="OnConditionChangedAsync"> |
| 91 | + <ComboBox.ItemTemplate> |
| 92 | + <DataTemplate x:DataType="uwp:PgcConditionItemViewModel"> |
| 93 | + <TextBlock Text="{x:Bind Name, Mode=OneWay}" /> |
| 94 | + </DataTemplate> |
| 95 | + </ComboBox.ItemTemplate> |
| 96 | + <ComboBox.HeaderTemplate> |
| 97 | + <DataTemplate> |
| 98 | + <TextBlock |
| 99 | + FontSize="12" |
| 100 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 101 | + Text="{Binding}" /> |
| 102 | + </DataTemplate> |
| 103 | + </ComboBox.HeaderTemplate> |
| 104 | + </ComboBox> |
| 105 | + </DataTemplate> |
| 106 | + </muxc:ItemsRepeater.ItemTemplate> |
| 107 | + </muxc:ItemsRepeater> |
| 108 | + </Grid> |
| 109 | + |
| 110 | + <Grid Grid.Row="2" Margin="0,12,0,0"> |
| 111 | + <ScrollViewer |
| 112 | + x:Name="ContentScrollViewer" |
| 113 | + Padding="{StaticResource DefaultContainerPadding}" |
| 114 | + HorizontalScrollMode="Disabled" |
| 115 | + VerticalScrollBarVisibility="Auto" |
| 116 | + Visibility="{x:Bind ViewModel.IsIndexInitializeLoading, Converter={StaticResource BoolToVisibilityReverseConverter}}"> |
| 117 | + <controls:VerticalRepeaterView |
| 118 | + x:Name="IndexView" |
| 119 | + Margin="0,0,0,12" |
| 120 | + HeaderVisibility="Collapsed" |
| 121 | + ItemTemplate="{StaticResource WideSeasonItemTemplate}" |
| 122 | + ItemsSource="{x:Bind ViewModel.ItemCollection, Mode=OneWay}" |
| 123 | + MinWideItemHeight="180" |
| 124 | + MinWideItemWidth="300" |
| 125 | + RequestLoadMore="OnViewRequestLoadMoreAsync" /> |
| 126 | + </ScrollViewer> |
| 127 | + |
| 128 | + <controls:OverlayLoadingPanel IsBarActive="{x:Bind ViewModel.IsIndexDeltaLoading, Mode=OneWay}" IsRingActive="{x:Bind ViewModel.IsIndexInitializeLoading, Mode=OneWay}" /> |
| 129 | + <controls:ErrorPanel |
| 130 | + ActionButtonClick="OnIndexRefreshButtonClickAsync" |
| 131 | + ActionContent="{loc:LocaleLocator Name=Refresh}" |
| 132 | + Text="{x:Bind ViewModel.IndexErrorText, Mode=OneWay}" |
| 133 | + Visibility="{x:Bind ViewModel.IsIndexError, Mode=OneWay}" /> |
| 134 | + </Grid> |
| 135 | + </Grid> |
| 136 | +</Page> |
0 commit comments