diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs b/src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs new file mode 100644 index 0000000000..b28641c043 --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Control/Behavior/StartAnimationActionNoThrow.cs @@ -0,0 +1,31 @@ +// Copyright (c) DGP Studio. All rights reserved. +// Licensed under the MIT license. + +using CommunityToolkit.WinUI.Animations; +using Microsoft.UI.Xaml; +using Microsoft.Xaml.Interactivity; + +namespace Snap.Hutao.Control.Behavior; + +[DependencyProperty("Animation", typeof(AnimationSet))] +[DependencyProperty("TargetObject", typeof(UIElement))] +internal sealed partial class StartAnimationActionNoThrow : DependencyObject, IAction +{ + /// + public object Execute(object sender, object parameter) + { + if (Animation is not null) + { + if (TargetObject is not null) + { + Animation.Start(TargetObject); + } + else + { + Animation.Start(sender as UIElement); + } + } + + return default!; + } +} \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml b/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml index 46d10041c7..d20b99d64b 100644 --- a/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml +++ b/src/Snap.Hutao/Snap.Hutao/Control/Theme/ItemsPanelTemplate.xaml @@ -20,4 +20,10 @@ Columns="5" RowSpacing="4"/> + + + diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml index 9aa6881296..2677c78a18 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml @@ -164,6 +164,21 @@ + + + + @@ -282,6 +297,7 @@ PaneBackground="{x:Null}"> - - - @@ -301,16 +312,10 @@ - - - - + SelectionMode="None"/> diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml index b5f3f6f362..cd672dbb00 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AnnouncementPage.xaml @@ -29,9 +29,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -184,7 +189,6 @@ - @@ -223,11 +227,11 @@ diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml index 8aef9263c3..f3295f408c 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml @@ -58,6 +58,382 @@ GridValue="{x:Bind GridImageExportPanel}" ListValue="{x:Bind ListImageExportPanel}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -110,12 +486,10 @@ - - - - - - + @@ -123,117 +497,9 @@ Margin="16,16,4,-8" cwa:ItemsReorderAnimation.Duration="0:0:0.1" ItemContainerStyle="{StaticResource LargeGridViewItemStyle}" + ItemTemplate="{StaticResource AvatarGridViewTemplate}" ItemsSource="{Binding Summary.Avatars}" - SelectedItem="{Binding SelectedAvatar, Mode=TwoWay}"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + SelectedItem="{Binding SelectedAvatar, Mode=TwoWay}"/> @@ -245,66 +511,10 @@ OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength2}" PaneBackground="Transparent"> - - - - - - - - - - - - - - - - - - - - - - - + @@ -449,12 +659,8 @@ Grid.Row="1" Grid.Column="0" Margin="16" + ItemsPanel="{StaticResource HorizontalStackPanelTemplate}" ItemsSource="{Binding SelectedAvatar.Constellations}"> - - - - - - - - + ItemTemplate="{StaticResource AvatarConstellationTemplate}" + ItemsSource="{Binding SelectedAvatar.Skills}"/> @@ -598,221 +742,19 @@ HorizontalContentAlignment="Stretch" Background="{x:Null}" Header="{shcm:ResourceString Name=ViewPageAvatarPropertyHeader}"> - + - - - - - - - - - - - - - - - - - - - - - + ItemTemplate="{StaticResource AvatarPropertyTemplate}" + ItemsSource="{Binding SelectedAvatar.Properties}"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml index ba5c34e4a6..0dea4549d4 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml +++ b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml @@ -20,27 +20,39 @@ mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + - - - 0.4 - - - 1 - - + + + 0.4 + + + 1 + + - - - - - - - + + @@ -176,7 +188,7 @@ Margin="6,0,0,0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" - Background="{Binding IsToday, Converter={StaticResource BoolToBrushSelector}}" + Background="{Binding IsToday, Converter={ThemeResource BoolToBrushSelector}}" Command="{Binding Path=DataContext.FinishStateCommand, Source={StaticResource BindingProxy}}" CommandParameter="{Binding}" Style="{StaticResource ButtonRevealStyle}">