diff --git a/src/App/App.csproj b/src/App/App.csproj index a320c22eeb4e49dd90bf513dfd6f71d381424061..ead79d71af754fdb178ca3d54b79aa1b0dbe9b34 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -20,10 +20,11 @@ AccountAvatar.xaml - + BannerView.xaml + IconTextBlock.xaml @@ -212,6 +213,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -220,6 +225,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/App/Controls/Bili/BannerItem.cs b/src/App/Controls/Bili/BannerItem/BannerItem.cs similarity index 100% rename from src/App/Controls/Bili/BannerItem.cs rename to src/App/Controls/Bili/BannerItem/BannerItem.cs diff --git a/src/App/Controls/Bili/BannerItem/BannerItem.xaml b/src/App/Controls/Bili/BannerItem/BannerItem.xaml new file mode 100644 index 0000000000000000000000000000000000000000..d3b87ceff73f104d6d935a8b4788c50a39358aca --- /dev/null +++ b/src/App/Controls/Bili/BannerItem/BannerItem.xaml @@ -0,0 +1,72 @@ + + + + diff --git a/src/App/Controls/Bili/PartitionItem.xaml b/src/App/Controls/Bili/PartitionItem.xaml index bcbfdc593611390465427d396612a08f5c458edc..06697b20cefb32c3f291d2d196965c332a1a6f7f 100644 --- a/src/App/Controls/Bili/PartitionItem.xaml +++ b/src/App/Controls/Bili/PartitionItem.xaml @@ -9,15 +9,7 @@ d:DesignWidth="400" mc:Ignorable="d"> - + @@ -45,5 +37,5 @@ TextAlignment="Center" /> - + diff --git a/src/App/Controls/Bili/PartitionItem.xaml.cs b/src/App/Controls/Bili/PartitionItem.xaml.cs index 1d88681e107116fcf56ee7e2c8318028d092a135..d308033d967a1aa27dd953af658ff738df91f0c6 100644 --- a/src/App/Controls/Bili/PartitionItem.xaml.cs +++ b/src/App/Controls/Bili/PartitionItem.xaml.cs @@ -52,9 +52,8 @@ namespace Richasy.Bili.App.Controls } } - private void OnItemTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) + private void OnItemClick(object sender, RoutedEventArgs e) { - e.Handled = true; var animationService = ConnectedAnimationService.GetForCurrentView(); animationService.PrepareToAnimate("PartitionAnimate", this.ContentContainer); ItemClick?.Invoke(this, Data); diff --git a/src/App/Controls/Bili/VideoItem.xaml b/src/App/Controls/Bili/VideoItem.xaml index a3f0085fff02a33853c6db3cfb71854fe4e494ef..b74ba209da9b5ca4c6351fcc49142a01aea3e80d 100644 --- a/src/App/Controls/Bili/VideoItem.xaml +++ b/src/App/Controls/Bili/VideoItem.xaml @@ -20,22 +20,10 @@ - - - - - - - - - - + Click="OnContainerClick"> @@ -65,134 +53,146 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - + x:Name="CoverContainer" + Height="124" + CornerRadius="4,4,0,0" + Margin="1,0" + VerticalAlignment="Stretch"> + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - + + - - + UserName="{x:Bind ViewModel.PublisherName, Mode=OneWay}" /> + - - - - - - - - - - - + Padding="12,8" + RowSpacing="8"> + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/src/App/Controls/Bili/VideoItem.xaml.cs b/src/App/Controls/Bili/VideoItem.xaml.cs index 8ea26098b4b84861b80e5a7225f1e5eab440221c..ecae40ba644c539dc5bcbd7ba2ac9bf2d934943d 100644 --- a/src/App/Controls/Bili/VideoItem.xaml.cs +++ b/src/App/Controls/Bili/VideoItem.xaml.cs @@ -182,7 +182,7 @@ namespace Richasy.Bili.App.Controls CheckOrientation(); } - private void OnContainerTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) + private void OnContainerClick(object sender, RoutedEventArgs e) { } } diff --git a/src/App/Controls/CardPanel/CardPanel.cs b/src/App/Controls/CardPanel/CardPanel.cs new file mode 100644 index 0000000000000000000000000000000000000000..74d3babd3b2203f0848182709ff23b64c7547fa7 --- /dev/null +++ b/src/App/Controls/CardPanel/CardPanel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Richasy. All rights reserved. + +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +namespace Richasy.Bili.App.Controls +{ + /// + /// 卡片容器,包含基本的Pointer动画. + /// + public class CardPanel : Button + { + private long _pointerOverToken; + private long _pressedToken; + + /// + /// Initializes a new instance of the class. + /// + public CardPanel() + { + this.DefaultStyleKey = typeof(CardPanel); + Loading += OnCardPanelLoading; + Unloaded += OnCardPanelUnloaded; + } + + /// + protected override void OnApplyTemplate() => base.OnApplyTemplate(); + + private void OnCardPanelLoading(FrameworkElement sender, object args) + { + _pointerOverToken = RegisterPropertyChangedCallback(IsPointerOverProperty, OnPanelStateChanged); + _pressedToken = RegisterPropertyChangedCallback(IsPressedProperty, OnPanelStateChanged); + } + + private void OnCardPanelUnloaded(object sender, RoutedEventArgs e) + { + UnregisterPropertyChangedCallback(IsPointerOverProperty, _pointerOverToken); + UnregisterPropertyChangedCallback(IsPressedProperty, _pressedToken); + } + + private void OnPanelStateChanged(DependencyObject sender, DependencyProperty dp) + { + if (IsPressed) + { + } + else if (IsPointerOver) + { + } + else + { + } + } + } +} diff --git a/src/App/Controls/CardPanel/CardPanel.xaml b/src/App/Controls/CardPanel/CardPanel.xaml new file mode 100644 index 0000000000000000000000000000000000000000..771038cf5376078de45a4ea4a72ee89f77c0287a --- /dev/null +++ b/src/App/Controls/CardPanel/CardPanel.xaml @@ -0,0 +1,76 @@ + + + + + + diff --git a/src/App/Themes/Generic.xaml b/src/App/Themes/Generic.xaml index d430d78eb357f7415b49778c26e0e9623c4c3bff..c5d8de121eb0958936dffde53e1a8007afc28c10 100644 --- a/src/App/Themes/Generic.xaml +++ b/src/App/Themes/Generic.xaml @@ -1,73 +1,6 @@ - - - + + + + +