Skip to content

Commit

Permalink
page style
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Oct 31, 2023
1 parent 07c5201 commit 07d42ce
Show file tree
Hide file tree
Showing 6 changed files with 602 additions and 602 deletions.
Original file line number Diff line number Diff line change
@@ -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
{
/// <inheritdoc/>
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!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
Columns="5"
RowSpacing="4"/>
</ItemsPanelTemplate>
<ItemsPanelTemplate x:Key="UniformGridColumns5Spacing8Template">
<cwcont:UniformGrid
ColumnSpacing="8"
Columns="5"
RowSpacing="8"/>
</ItemsPanelTemplate>
</ResourceDictionary>
31 changes: 18 additions & 13 deletions src/Snap.Hutao/Snap.Hutao/View/Page/AchievementPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@
</Grid>
</Border>
</DataTemplate>

<Style
x:Key="AchievementGoalListViewItemStyle"
BasedOn="{StaticResource DefaultListViewItemStyle}"
TargetType="ListViewItem">
<Setter Property="Margin" Value="0,0,6,0"/>
</Style>

<Style
x:Key="AchievementListViewItemStyle"
BasedOn="{StaticResource DefaultListViewItemStyle}"
TargetType="ListViewItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0,4,8,0"/>
</Style>
</Page.Resources>

<mxi:Interaction.Behaviors>
Expand Down Expand Up @@ -282,35 +297,25 @@
PaneBackground="{x:Null}">
<SplitView.Pane>
<ListView
ItemContainerStyle="{StaticResource AchievementGoalListViewItemStyle}"
ItemTemplate="{StaticResource AchievementGoalListTemplate}"
ItemsSource="{Binding AchievementGoals}"
SelectedItem="{Binding SelectedAchievementGoal, Mode=TwoWay}"
SelectionMode="Single">
<mxi:Interaction.Behaviors>
<shcb:SelectedItemInViewBehavior/>
</mxi:Interaction.Behaviors>
<ListView.ItemContainerStyle>
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="Margin" Value="0,0,6,0"/>
</Style>
</ListView.ItemContainerStyle>
</ListView>
</SplitView.Pane>

<SplitView.Content>
<ListView
Margin="8,0,0,0"
Padding="0,0,0,8"
ItemContainerStyle="{StaticResource AchievementListViewItemStyle}"
ItemTemplate="{StaticResource AchievementTemplate}"
ItemsSource="{Binding Achievements}"
SelectionMode="None">
<ListView.ItemContainerStyle>
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0,4,8,0"/>
</Style>
</ListView.ItemContainerStyle>
</ListView>
SelectionMode="None"/>
</SplitView.Content>
</SplitView>
</cwc:Case>
Expand Down
Loading

0 comments on commit 07d42ce

Please # to comment.