Skip to content

Commit c8f4449

Browse files
authored
PGC支持 (Richasy#5)
添加对PGC内容的支持,包括番剧/国创/电影/电视剧/纪录片。
1 parent 16722ca commit c8f4449

82 files changed

Lines changed: 3125 additions & 304 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/App/App.csproj

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<Compile Include="$(SolutionDir)\src\Shared\SharedAssemblyInfo.cs">
1818
<Link>Properties\SharedAssemblyInfo.cs</Link>
1919
</Compile>
20-
<Compile Include="Controls\Animator\CardCollectionAnimator.cs" />
2120
<Compile Include="Controls\CardPanel\CardPanel.Fields.cs" />
2221
<Compile Include="Controls\CardPanel\CardPanel.Properties.cs" />
2322
<Compile Include="Controls\CardPanel\CardPanelAutomationPeer.cs" />
@@ -39,6 +38,9 @@
3938
<Compile Include="Controls\Live\FollowLiveView.xaml.cs">
4039
<DependentUpon>FollowLiveView.xaml</DependentUpon>
4140
</Compile>
41+
<Compile Include="Controls\Common\PgcItem.xaml.cs">
42+
<DependentUpon>PgcItem.xaml</DependentUpon>
43+
</Compile>
4244
<Compile Include="Controls\User\AccountAvatar.xaml.cs">
4345
<DependentUpon>AccountAvatar.xaml</DependentUpon>
4446
</Compile>
@@ -80,6 +82,9 @@
8082
<Compile Include="Controls\Shadow\CardAttachedShadow.cs" />
8183
<Compile Include="Controls\Shadow\IAttachedShadow.cs" />
8284
<Compile Include="Controls\Shadow\Shadows.cs" />
85+
<Compile Include="Pages\Reuse\AnimePage.xaml.cs">
86+
<DependentUpon>AnimePage.xaml</DependentUpon>
87+
</Compile>
8388
<Compile Include="Pages\DocumentaryPage.xaml.cs">
8489
<DependentUpon>DocumentaryPage.xaml</DependentUpon>
8590
</Compile>
@@ -89,8 +94,11 @@
8994
<Compile Include="Pages\DynamicFeedPage.xaml.cs">
9095
<DependentUpon>DynamicFeedPage.xaml</DependentUpon>
9196
</Compile>
92-
<Compile Include="Pages\ForeignAnimePage.xaml.cs">
93-
<DependentUpon>ForeignAnimePage.xaml</DependentUpon>
97+
<Compile Include="Pages\BangumiPage.xaml.cs">
98+
<DependentUpon>BangumiPage.xaml</DependentUpon>
99+
</Compile>
100+
<Compile Include="Pages\Reuse\FeedPage.xaml.cs">
101+
<DependentUpon>FeedPage.xaml</DependentUpon>
94102
</Compile>
95103
<Compile Include="Pages\HelpPage.xaml.cs">
96104
<DependentUpon>HelpPage.xaml</DependentUpon>
@@ -261,6 +269,10 @@
261269
<SubType>Designer</SubType>
262270
<Generator>MSBuild:Compile</Generator>
263271
</Page>
272+
<Page Include="Controls\Common\PgcItem.xaml">
273+
<SubType>Designer</SubType>
274+
<Generator>MSBuild:Compile</Generator>
275+
</Page>
264276
<Page Include="Controls\User\AccountAvatar.xaml">
265277
<SubType>Designer</SubType>
266278
<Generator>MSBuild:Compile</Generator>
@@ -305,6 +317,10 @@
305317
<SubType>Designer</SubType>
306318
<Generator>MSBuild:Compile</Generator>
307319
</Page>
320+
<Page Include="Pages\Reuse\AnimePage.xaml">
321+
<SubType>Designer</SubType>
322+
<Generator>MSBuild:Compile</Generator>
323+
</Page>
308324
<Page Include="Pages\DocumentaryPage.xaml">
309325
<SubType>Designer</SubType>
310326
<Generator>MSBuild:Compile</Generator>
@@ -317,7 +333,11 @@
317333
<SubType>Designer</SubType>
318334
<Generator>MSBuild:Compile</Generator>
319335
</Page>
320-
<Page Include="Pages\ForeignAnimePage.xaml">
336+
<Page Include="Pages\BangumiPage.xaml">
337+
<SubType>Designer</SubType>
338+
<Generator>MSBuild:Compile</Generator>
339+
</Page>
340+
<Page Include="Pages\Reuse\FeedPage.xaml">
321341
<SubType>Designer</SubType>
322342
<Generator>MSBuild:Compile</Generator>
323343
</Page>

src/App/App.xaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
<ResourceDictionary x:Key="HighContrast" Source="ms-appx:///Styles/Theme.HighContrast.xaml" />
1818
</ResourceDictionary.ThemeDictionaries>
1919

20-
<animator:CardCollectionAnimator x:Key="CardCollectionAnimator" />
21-
2220
<converter:SortTypeTextConverter x:Key="SortTypeTextConverter" />
2321
<converter:UserLevelConverter x:Key="UserLevelConverter" />
2422
<converter:ObjectToBoolConverter x:Key="ObjectToBoolConverter" />

src/App/Controls/Animator/CardCollectionAnimator.cs

Lines changed: 0 additions & 162 deletions
This file was deleted.

src/App/Controls/App/IconTextBlock.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
d:DesignWidth="400"
1111
mc:Ignorable="d">
1212

13-
<Grid ColumnSpacing="{x:Bind Spacing, Mode=OneWay}">
13+
<Grid ColumnSpacing="{x:Bind Spacing, Mode=OneWay}" Margin="0,2">
1414
<Grid.ColumnDefinitions>
1515
<ColumnDefinition Width="Auto" />
1616
<ColumnDefinition Width="*" />

src/App/Controls/App/IconTextBlock.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public sealed partial class IconTextBlock : UserControl
2121
/// <see cref="Spacing"/>的依赖属性.
2222
/// </summary>
2323
public static readonly DependencyProperty SpacingProperty =
24-
DependencyProperty.Register(nameof(Spacing), typeof(double), typeof(IconTextBlock), new PropertyMetadata(0d));
24+
DependencyProperty.Register(nameof(Spacing), typeof(double), typeof(IconTextBlock), new PropertyMetadata(8d));
2525

2626
/// <summary>
2727
/// <see cref="Symbol"/>的依赖属性.

src/App/Controls/App/RootNavigationView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<muxc:NavigationViewItemSeparator />
8383

8484
<muxc:NavigationViewItemHeader Content="{loc:LocaleLocator Name=Topic}" />
85-
<muxc:NavigationViewItem ext:NavigationExtension.PageId="ForeignAnime" Content="{loc:LocaleLocator Name=ForeignAnime}">
85+
<muxc:NavigationViewItem ext:NavigationExtension.PageId="Bangumi" Content="{loc:LocaleLocator Name=Bangumi}">
8686
<muxc:NavigationViewItem.Icon>
8787
<icons:FluentIconElement Symbol="Cookies20" />
8888
</muxc:NavigationViewItem.Icon>

src/App/Controls/App/RootNavigationView.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ private void CheckMainContentNavigation()
121121
case PageIds.SpecialColumn:
122122
pageType = typeof(SpecialColumnPage);
123123
break;
124-
case PageIds.ForeignAnime:
125-
pageType = typeof(ForeignAnimePage);
124+
case PageIds.Bangumi:
125+
pageType = typeof(BangumiPage);
126126
break;
127127
case PageIds.DomesticAnime:
128128
pageType = typeof(DomesticAnimePage);

src/App/Controls/Banner/BannerItem/BannerItem.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ public sealed class BannerItem : Control
4343
public static readonly DependencyProperty MaxImageHeightProperty =
4444
DependencyProperty.Register(nameof(MaxImageHeight), typeof(double), typeof(BannerItem), new PropertyMetadata(114d));
4545

46+
/// <summary>
47+
/// <see cref="MinImageHeight"/>的依赖属性.
48+
/// </summary>
49+
public static readonly DependencyProperty MinImageHeightProperty =
50+
DependencyProperty.Register(nameof(MinImageHeight), typeof(double), typeof(BannerItem), new PropertyMetadata(100d));
51+
4652
/// <summary>
4753
/// <see cref="CardStyle"/>的依赖属性.
4854
/// </summary>
@@ -102,6 +108,15 @@ public double MaxImageHeight
102108
set { SetValue(MaxImageHeightProperty, value); }
103109
}
104110

111+
/// <summary>
112+
/// 图片最小高度.
113+
/// </summary>
114+
public double MinImageHeight
115+
{
116+
get { return (double)GetValue(MinImageHeightProperty); }
117+
set { SetValue(MinImageHeightProperty, value); }
118+
}
119+
105120
/// <summary>
106121
/// 内部容器<see cref="CardPanel"/>的样式.
107122
/// </summary>

src/App/Controls/Banner/BannerItem/BannerItem.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
x:Name="BannerImage"
1717
AutomationProperties.Name="{TemplateBinding Title}"
1818
MinWidth="300"
19-
MinHeight="100"
19+
MinHeight="{TemplateBinding MinImageHeight}"
2020
MaxHeight="{TemplateBinding MaxImageHeight}"
21+
VerticalAlignment="Stretch"
2122
IsTabStop="False"
2223
LazyLoadingEnabled="True"
2324
RetryCount="2"

src/App/Controls/Banner/BannerView.xaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@
1010
d:DesignWidth="400"
1111
mc:Ignorable="d">
1212
<Grid>
13-
<local:HorizontalRepeaterView ItemsSource="{x:Bind ItemsSource, Mode=OneWay}">
13+
<local:HorizontalRepeaterView Style="{x:Bind ViewStyle, Mode=OneWay}" ItemsSource="{x:Bind ItemsSource, Mode=OneWay}">
1414
<local:HorizontalRepeaterView.WideItemTemplate>
1515
<DataTemplate x:DataType="uwp:BannerViewModel">
1616
<local:BannerItem
17-
Title="{x:Bind Description}"
17+
Title="{x:Bind Description, Mode=OneWay}"
1818
IsTooltipEnabled="{x:Bind IsTooltipEnabled}"
19-
Source="{x:Bind Cover}"
19+
MinImageHeight="{x:Bind MinHeight, Mode=OneWay}"
20+
Source="{x:Bind Cover, Mode=OneWay}"
2021
TabFocusNavigation="Local"
21-
Uri="{x:Bind Uri}" />
22+
Uri="{x:Bind Uri, Mode=OneWay}" />
2223
</DataTemplate>
2324
</local:HorizontalRepeaterView.WideItemTemplate>
2425
<local:HorizontalRepeaterView.NarrowItemTemplate>
2526
<DataTemplate x:DataType="uwp:BannerViewModel">
2627
<local:BannerItem
27-
Title="{x:Bind Description}"
28-
IsTooltipEnabled="{x:Bind IsTooltipEnabled}"
28+
Title="{x:Bind Description, Mode=OneWay}"
29+
IsTooltipEnabled="{x:Bind IsTooltipEnabled, Mode=OneWay}"
2930
MaxImageHeight="999"
30-
Source="{x:Bind Cover}"
31-
Uri="{x:Bind Uri}">
31+
Source="{x:Bind Cover, Mode=OneWay}"
32+
Uri="{x:Bind Uri, Mode=OneWay}">
3233
<local:BannerItem.CardStyle>
3334
<Style TargetType="local:CardPanel">
3435
<Setter Property="IsEnableHoverAnimation" Value="False" />

0 commit comments

Comments
 (0)