mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
update controls style
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
<!-- Brushes -->
|
<!-- Brushes -->
|
||||||
<SolidColorBrush x:Key="AvatarPropertyAddValueBrush" Color="{ThemeResource AvatarPropertyAddValueColor}"/>
|
<SolidColorBrush x:Key="AvatarPropertyAddValueBrush" Color="{ThemeResource AvatarPropertyAddValueColor}"/>
|
||||||
|
<SolidColorBrush x:Key="BlueBrush" Color="#FF5180CB"/>
|
||||||
<SolidColorBrush x:Key="PurpleBrush" Color="#FFA156E0"/>
|
<SolidColorBrush x:Key="PurpleBrush" Color="#FFA156E0"/>
|
||||||
<SolidColorBrush x:Key="OrangeBrush" Color="#FFBC6932"/>
|
<SolidColorBrush x:Key="OrangeBrush" Color="#FFBC6932"/>
|
||||||
<!-- Settings -->
|
<!-- Settings -->
|
||||||
@@ -103,6 +104,9 @@
|
|||||||
|
|
||||||
<!-- FontIcon Content -->
|
<!-- FontIcon Content -->
|
||||||
<x:String x:Key="FontIconContentSetting"></x:String>
|
<x:String x:Key="FontIconContentSetting"></x:String>
|
||||||
|
<x:String x:Key="FontIconContentFolder"></x:String>
|
||||||
|
<x:String x:Key="FontIconContentAsteriskBadge12"></x:String>
|
||||||
|
<x:String x:Key="FontIconContentZipFolder"></x:String>
|
||||||
<!-- Converters -->
|
<!-- Converters -->
|
||||||
<cwuc:BoolNegationConverter x:Key="BoolNegationConverter"/>
|
<cwuc:BoolNegationConverter x:Key="BoolNegationConverter"/>
|
||||||
<cwuc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
<cwuc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||||
@@ -132,8 +136,8 @@
|
|||||||
<shvc:Int32ToVisibilityConverter x:Key="Int32ToVisibilityConverter"/>
|
<shvc:Int32ToVisibilityConverter x:Key="Int32ToVisibilityConverter"/>
|
||||||
<shvc:Int32ToVisibilityRevertConverter x:Key="Int32ToVisibilityRevertConverter"/>
|
<shvc:Int32ToVisibilityRevertConverter x:Key="Int32ToVisibilityRevertConverter"/>
|
||||||
<shvc:StringBoolConverter x:Key="StringBoolConverter"/>
|
<shvc:StringBoolConverter x:Key="StringBoolConverter"/>
|
||||||
<!-- Styles -->
|
|
||||||
|
|
||||||
|
<!-- Styles -->
|
||||||
<Style
|
<Style
|
||||||
x:Key="LargeGridViewItemStyle"
|
x:Key="LargeGridViewItemStyle"
|
||||||
BasedOn="{StaticResource DefaultGridViewItemStyle}"
|
BasedOn="{StaticResource DefaultGridViewItemStyle}"
|
||||||
@@ -473,7 +477,6 @@
|
|||||||
<VisualState x:Name="AccentColorBorder">
|
<VisualState x:Name="AccentColorBorder">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="BackgroundElement.BorderBrush" Value="{ThemeResource SystemControlForegroundAccentBrush}"/>
|
<Setter Target="BackgroundElement.BorderBrush" Value="{ThemeResource SystemControlForegroundAccentBrush}"/>
|
||||||
|
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
|
|
||||||
@@ -484,6 +487,7 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- ItemsPanelTemplate -->
|
<!-- ItemsPanelTemplate -->
|
||||||
<ItemsPanelTemplate x:Key="ItemsStackPanelTemplate">
|
<ItemsPanelTemplate x:Key="ItemsStackPanelTemplate">
|
||||||
<ItemsStackPanel/>
|
<ItemsStackPanel/>
|
||||||
@@ -494,6 +498,10 @@
|
|||||||
<ItemsPanelTemplate x:Key="HorizontalStackPanelTemplate">
|
<ItemsPanelTemplate x:Key="HorizontalStackPanelTemplate">
|
||||||
<StackPanel Orientation="Horizontal"/>
|
<StackPanel Orientation="Horizontal"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
|
<!-- Transitions -->
|
||||||
|
<TransitionCollection x:Key="ReorderThemeTransitions">
|
||||||
|
<ReorderThemeTransition/>
|
||||||
|
</TransitionCollection>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
@@ -12,6 +12,11 @@ namespace Snap.Hutao.Extension;
|
|||||||
[HighQuality]
|
[HighQuality]
|
||||||
internal static partial class EnumerableExtension
|
internal static partial class EnumerableExtension
|
||||||
{
|
{
|
||||||
|
public static TElement? ElementAtOrLastOrDefault<TElement>(this IEnumerable<TElement> source, int index)
|
||||||
|
{
|
||||||
|
return source.ElementAtOrDefault(index) ?? source.LastOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 如果传入集合不为空则原路返回,
|
/// 如果传入集合不为空则原路返回,
|
||||||
/// 如果传入集合为空返回一个集合的空集
|
/// 如果传入集合为空返回一个集合的空集
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
Text="{Binding Uid}"/>
|
Text="{Binding Uid}"/>
|
||||||
<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
|
<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
|
||||||
<StackPanel VerticalAlignment="Center">
|
<StackPanel VerticalAlignment="Center">
|
||||||
<shci:CachedImage shvh:ControlHelper.SquareLength="64" Source="{StaticResource UI_ItemIcon_210}"/>
|
<shci:CachedImage shvh:FrameworkElementHelper.SquareLength="64" Source="{StaticResource UI_ItemIcon_210}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
Margin="8"
|
Margin="8"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
shvh:ControlHelper.SquareLength="8"
|
shvh:FrameworkElementHelper.SquareLength="8"
|
||||||
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
||||||
Visibility="{Binding ResinNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
Visibility="{Binding ResinNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
|
|
||||||
<Grid Grid.Row="0" Style="{StaticResource BorderGridStyle}">
|
<Grid Grid.Row="0" Style="{StaticResource BorderGridStyle}">
|
||||||
<StackPanel VerticalAlignment="Center">
|
<StackPanel VerticalAlignment="Center">
|
||||||
<shci:CachedImage shvh:ControlHelper.SquareLength="32" Source="{StaticResource UI_ItemIcon_204}"/>
|
<shci:CachedImage shvh:FrameworkElementHelper.SquareLength="32" Source="{StaticResource UI_ItemIcon_204}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -84,14 +84,14 @@
|
|||||||
Margin="8"
|
Margin="8"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
shvh:ControlHelper.SquareLength="8"
|
shvh:FrameworkElementHelper.SquareLength="8"
|
||||||
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
||||||
Visibility="{Binding HomeCoinNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
Visibility="{Binding HomeCoinNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
|
<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
|
||||||
<StackPanel VerticalAlignment="Center">
|
<StackPanel VerticalAlignment="Center">
|
||||||
<shci:CachedImage shvh:ControlHelper.SquareLength="32" Source="{StaticResource UI_MarkQuest_Events_Proce}"/>
|
<shci:CachedImage shvh:FrameworkElementHelper.SquareLength="32" Source="{StaticResource UI_MarkQuest_Events_Proce}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
Margin="8"
|
Margin="8"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
shvh:ControlHelper.SquareLength="8"
|
shvh:FrameworkElementHelper.SquareLength="8"
|
||||||
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
||||||
Visibility="{Binding DailyTaskNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
Visibility="{Binding DailyTaskNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
|
|
||||||
<Grid Grid.Row="0" Style="{StaticResource BorderGridStyle}">
|
<Grid Grid.Row="0" Style="{StaticResource BorderGridStyle}">
|
||||||
<StackPanel VerticalAlignment="Center">
|
<StackPanel VerticalAlignment="Center">
|
||||||
<shci:CachedImage shvh:ControlHelper.SquareLength="32" Source="{StaticResource UI_MarkTower}"/>
|
<shci:CachedImage shvh:FrameworkElementHelper.SquareLength="32" Source="{StaticResource UI_MarkTower}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
|
|
||||||
<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
|
<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
|
||||||
<StackPanel VerticalAlignment="Center">
|
<StackPanel VerticalAlignment="Center">
|
||||||
<shci:CachedImage shvh:ControlHelper.SquareLength="32" Source="{StaticResource UI_ItemIcon_220021}"/>
|
<shci:CachedImage shvh:FrameworkElementHelper.SquareLength="32" Source="{StaticResource UI_ItemIcon_220021}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
Margin="8"
|
Margin="8"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
shvh:ControlHelper.SquareLength="8"
|
shvh:FrameworkElementHelper.SquareLength="8"
|
||||||
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
|
||||||
Visibility="{Binding TransformerNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
Visibility="{Binding TransformerNotifySuppressed, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Border Style="{StaticResource BorderCardStyle}">
|
||||||
<StackPanel Name="BackgroundStack">
|
<StackPanel Background="{x:Bind Fill}">
|
||||||
<ContentPresenter Name="ContentHost"/>
|
<ContentPresenter Content="{x:Bind TopContent, Mode=OneWay}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Name="TextHost"
|
|
||||||
MaxWidth="80"
|
MaxWidth="80"
|
||||||
Margin="0,0,0,2"
|
Margin="0,0,0,2"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
|
Text="{x:Bind Text, Mode=OneWay}"
|
||||||
TextTrimming="CharacterEllipsis"
|
TextTrimming="CharacterEllipsis"
|
||||||
TextWrapping="NoWrap"/>
|
TextWrapping="NoWrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ namespace Snap.Hutao.View.Control;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[HighQuality]
|
[HighQuality]
|
||||||
[ContentProperty(Name = nameof(TopContent))]
|
[ContentProperty(Name = nameof(TopContent))]
|
||||||
[DependencyProperty("Text", typeof(string), "", nameof(OnTextChanged))]
|
[DependencyProperty("Text", typeof(string), "")]
|
||||||
[DependencyProperty("TopContent", typeof(UIElement), default!, nameof(OnContentChanged))]
|
[DependencyProperty("TopContent", typeof(UIElement), default!)]
|
||||||
[DependencyProperty("Fill", typeof(Brush), default!, nameof(OnFillChanged))]
|
[DependencyProperty("Fill", typeof(Brush), default!)]
|
||||||
internal sealed partial class BottomTextControl : ContentControl
|
internal sealed partial class BottomTextControl : ContentControl
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -26,19 +26,4 @@ internal sealed partial class BottomTextControl : ContentControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnTextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
|
||||||
{
|
|
||||||
((BottomTextControl)sender).TextHost.Text = (string)args.NewValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnContentChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
|
||||||
{
|
|
||||||
((BottomTextControl)sender).ContentHost.Content = args.NewValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnFillChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
|
||||||
{
|
|
||||||
((BottomTextControl)sender).BackgroundStack.Background = (Brush)args.NewValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
<StackPanel Margin="0,0,0,0" VerticalAlignment="Top">
|
<StackPanel Margin="0,0,0,0" VerticalAlignment="Top">
|
||||||
<cwc:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
|
<cwc:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="ItemHost"
|
ItemsSource="{x:Bind Source, Mode=OneWay}"
|
||||||
SelectionChanged="ItemHostSelectionChanged"
|
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
|
||||||
Style="{StaticResource SettingsContentComboBoxStyle}">
|
Style="{StaticResource SettingsContentComboBoxStyle}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</cwc:SettingsCard>
|
</cwc:SettingsCard>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<ItemsControl x:Name="DetailsHost" VerticalAlignment="Top">
|
<ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind SelectedItem.Parameters, Mode=OneWay}">
|
||||||
<ItemsControl.ItemContainerTransitions>
|
<ItemsControl.ItemContainerTransitions>
|
||||||
<TransitionCollection>
|
<TransitionCollection>
|
||||||
<ContentThemeTransition/>
|
<ContentThemeTransition/>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace Snap.Hutao.View.Control;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[HighQuality]
|
[HighQuality]
|
||||||
[DependencyProperty("Source", typeof(List<LevelParameters<string, ParameterDescription>>), default!, nameof(OnSourceChanged))]
|
[DependencyProperty("Source", typeof(List<LevelParameters<string, ParameterDescription>>), default!, nameof(OnSourceChanged))]
|
||||||
|
[DependencyProperty("SelectedItem", typeof(LevelParameters<string, ParameterDescription>), default!)]
|
||||||
[DependencyProperty("PreferredSelectedIndex", typeof(int), 0)]
|
[DependencyProperty("PreferredSelectedIndex", typeof(int), 0)]
|
||||||
internal sealed partial class DescParamComboBox : UserControl
|
internal sealed partial class DescParamComboBox : UserControl
|
||||||
{
|
{
|
||||||
@@ -26,23 +27,12 @@ internal sealed partial class DescParamComboBox : UserControl
|
|||||||
|
|
||||||
private static void OnSourceChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
private static void OnSourceChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
|
||||||
{
|
{
|
||||||
// Some of the {x:Bind} feature is not working properly,
|
|
||||||
// so we use this simple code behind approach to achieve selection function
|
|
||||||
if (sender is DescParamComboBox descParamComboBox)
|
if (sender is DescParamComboBox descParamComboBox)
|
||||||
{
|
{
|
||||||
if (args.NewValue != args.OldValue && args.NewValue is List<LevelParameters<string, ParameterDescription>> list)
|
if (args.NewValue != args.OldValue && args.NewValue is List<LevelParameters<string, ParameterDescription>> list)
|
||||||
{
|
{
|
||||||
descParamComboBox.ItemHost.ItemsSource = list;
|
descParamComboBox.SelectedItem = list.ElementAtOrLastOrDefault(descParamComboBox.PreferredSelectedIndex);
|
||||||
descParamComboBox.ItemHost.SelectedIndex = Math.Min(descParamComboBox.PreferredSelectedIndex, list.Count - 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ItemHostSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is ComboBox { SelectedIndex: >= 0 } comboBox)
|
|
||||||
{
|
|
||||||
DetailsHost.ItemsSource = Source[comboBox.SelectedIndex]?.Parameters;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
xmlns:shcp="using:Snap.Hutao.Control.Panel"
|
xmlns:shcp="using:Snap.Hutao.Control.Panel"
|
||||||
xmlns:shvcont="using:Snap.Hutao.View.Control"
|
xmlns:shvcont="using:Snap.Hutao.View.Control"
|
||||||
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
||||||
|
xmlns:shvh="using:Snap.Hutao.View.Helper"
|
||||||
d:DataContext="{d:DesignInstance shvg:HutaoWishSummary}"
|
d:DataContext="{d:DesignInstance shvg:HutaoWishSummary}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
@@ -21,8 +22,7 @@
|
|||||||
Style="{StaticResource BorderCardStyle}">
|
Style="{StaticResource BorderCardStyle}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<shvcont:ItemIcon
|
<shvcont:ItemIcon
|
||||||
Width="40"
|
shvh:FrameworkElementHelper.SquareLength="40"
|
||||||
Height="40"
|
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
Quality="{Binding Quality}"/>
|
Quality="{Binding Quality}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Border Style="{StaticResource BorderCardStyle}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -56,64 +57,37 @@
|
|||||||
Margin="0,16,0,8"
|
Margin="0,16,0,8"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpText}"/>
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpText}"/>
|
||||||
<ItemsControl ItemTemplate="{StaticResource GridTemplate}" ItemsPanel="{StaticResource WrapPanelTemplate}" ItemsSource="{Binding UpItems}">
|
<ItemsControl
|
||||||
<ItemsControl.Transitions>
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
<TransitionCollection>
|
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
||||||
<ReorderThemeTransition/>
|
ItemsSource="{Binding UpItems}"/>
|
||||||
</TransitionCollection>
|
|
||||||
</ItemsControl.Transitions>
|
|
||||||
</ItemsControl>
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,16,0,8"
|
Margin="0,16,0,8"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
|
||||||
<ItemsControl ItemTemplate="{StaticResource GridTemplate}" ItemsSource="{Binding OrangeItems}">
|
<ItemsControl
|
||||||
<ItemsControl.Transitions>
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
<TransitionCollection>
|
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
||||||
<ReorderThemeTransition/>
|
ItemsSource="{Binding OrangeItems}"/>
|
||||||
</TransitionCollection>
|
|
||||||
</ItemsControl.Transitions>
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<cwucont:WrapPanel/>
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
</ItemsControl>
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,16,0,8"
|
Margin="0,16,0,8"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
|
||||||
<ItemsControl ItemTemplate="{StaticResource GridTemplate}" ItemsSource="{Binding PurpleItems}">
|
<ItemsControl
|
||||||
<ItemsControl.Transitions>
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
<TransitionCollection>
|
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
||||||
<ReorderThemeTransition/>
|
ItemsSource="{Binding PurpleItems}"/>
|
||||||
</TransitionCollection>
|
|
||||||
</ItemsControl.Transitions>
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<cwucont:WrapPanel/>
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
</ItemsControl>
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,16,0,8"
|
Margin="0,16,0,8"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>
|
||||||
<ItemsControl ItemTemplate="{StaticResource GridTemplate}" ItemsSource="{Binding BlueItems}">
|
<ItemsControl
|
||||||
<ItemsControl.Transitions>
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
<TransitionCollection>
|
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
||||||
<ReorderThemeTransition/>
|
ItemsSource="{Binding BlueItems}"/>
|
||||||
</TransitionCollection>
|
|
||||||
</ItemsControl.Transitions>
|
|
||||||
<ItemsControl.ItemsPanel>
|
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<cwucont:WrapPanel/>
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</ItemsControl.ItemsPanel>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||||
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
xmlns:shvh="using:Snap.Hutao.View.Helper"
|
||||||
Width="80"
|
shvh:FrameworkElementHelper.SquareLength="80"
|
||||||
Height="80"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<shmmc:QualityConverter x:Key="QualityConverter"/>
|
<shmmc:QualityConverter x:Key="QualityConverter"/>
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:shwhshl="using:Snap.Hutao.Web.Hoyolab.SdkStatic.Hk4e.Launcher"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
|
d:DataContext="{d:DesignInstance shwhshl:Package}"
|
||||||
IsExpanded="True"
|
IsExpanded="True"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
@@ -21,20 +23,20 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,4,0,0"
|
Margin="0,4,0,0"
|
||||||
Orientation="Horizontal">
|
Orientation="Horizontal">
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph=""/>
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentZipFolder}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Width="80"
|
Width="80"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding PackageSize, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
Text="{Binding PackageSize, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph=""/>
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentFolder}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Width="80"
|
Width="80"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Size, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
Text="{Binding Size, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph=""/>
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentAsteriskBadge12}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
IsTextSelectionEnabled="True"
|
IsTextSelectionEnabled="True"
|
||||||
@@ -63,20 +65,20 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,4,0,0"
|
Margin="0,4,0,0"
|
||||||
Orientation="Horizontal">
|
Orientation="Horizontal">
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph=""/>
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentZipFolder}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Width="80"
|
Width="80"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding PackageSize, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
Text="{Binding PackageSize, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph=""/>
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentFolder}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Width="80"
|
Width="80"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Size, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
Text="{Binding Size, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph=""/>
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentAsteriskBadge12}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
IsTextSelectionEnabled="True"
|
IsTextSelectionEnabled="True"
|
||||||
|
|||||||
@@ -6,14 +6,12 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||||
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
||||||
|
xmlns:shvh="using:Snap.Hutao.View.Helper"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<shmmc:SkillIconConverter x:Key="SkillIconConverter"/>
|
<shmmc:SkillIconConverter x:Key="SkillIconConverter"/>
|
||||||
|
|
||||||
<Thickness x:Key="PivotHeaderItemMargin">0,0,16,0</Thickness>
|
<Thickness x:Key="PivotHeaderItemMargin">0,0,16,0</Thickness>
|
||||||
<Thickness x:Key="PivotItemMargin">0</Thickness>
|
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource DefaultPivotHeaderItemStyle}" TargetType="PivotHeaderItem">
|
<Style BasedOn="{StaticResource DefaultPivotHeaderItemStyle}" TargetType="PivotHeaderItem">
|
||||||
<Setter Property="Height" Value="80"/>
|
<Setter Property="Height" Value="80"/>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -28,10 +26,7 @@
|
|||||||
<Pivot.HeaderTemplate>
|
<Pivot.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<shci:MonoChrome
|
<shci:MonoChrome shvh:FrameworkElementHelper.SquareLength="36" Source="{Binding Icon, Converter={StaticResource SkillIconConverter}}"/>
|
||||||
Width="36"
|
|
||||||
Height="36"
|
|
||||||
Source="{Binding Icon, Converter={StaticResource SkillIconConverter}}"/>
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,8,0,0"
|
Margin="0,8,0,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
|
|||||||
@@ -13,41 +13,37 @@
|
|||||||
xmlns:shvcont="using:Snap.Hutao.View.Control"
|
xmlns:shvcont="using:Snap.Hutao.View.Control"
|
||||||
xmlns:shvconv="using:Snap.Hutao.View.Converter"
|
xmlns:shvconv="using:Snap.Hutao.View.Converter"
|
||||||
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
||||||
|
xmlns:shvh="using:Snap.Hutao.View.Helper"
|
||||||
d:DataContext="{d:DesignInstance shvg:TypedWishSummary}"
|
d:DataContext="{d:DesignInstance shvg:TypedWishSummary}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<SolidColorBrush x:Key="BlueBrush" Color="#FF5180CB"/>
|
|
||||||
<SolidColorBrush x:Key="PurpleBrush" Color="#FFA156E0"/>
|
|
||||||
<SolidColorBrush x:Key="OrangeBrush" Color="#FFBC6932"/>
|
|
||||||
|
|
||||||
<shvconv:Int32ToGradientColorConverter x:Key="Int32ToGradientColorConverter" MaximumValue="{Binding GuaranteeOrangeThreshold}"/>
|
<shvconv:Int32ToGradientColorConverter x:Key="Int32ToGradientColorConverter" MaximumValue="{Binding GuaranteeOrangeThreshold}"/>
|
||||||
<shc:BindingProxy x:Key="SummaryProxy" DataContext="{Binding}"/>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="OrangeListTemplate" d:DataType="shvg:SummaryItem">
|
<DataTemplate x:Key="OrangeListTemplate" d:DataType="shvg:SummaryItem">
|
||||||
<Grid Margin="0,4,0,0" Background="Transparent">
|
<Grid
|
||||||
|
Margin="0,4,0,0"
|
||||||
|
Background="Transparent"
|
||||||
|
Style="{StaticResource BorderGridStyle}">
|
||||||
<ToolTipService.ToolTip>
|
<ToolTipService.ToolTip>
|
||||||
<TextBlock Text="{Binding TimeFormatted}"/>
|
<TextBlock Text="{Binding TimeFormatted}"/>
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<ProgressBar
|
||||||
<ProgressBar
|
MinHeight="32"
|
||||||
MinHeight="32"
|
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||||
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
Maximum="{Binding GuaranteeOrangeThreshold}"
|
||||||
Maximum="{Binding GuaranteeOrangeThreshold}"
|
Opacity="{StaticResource LargeBackgroundProgressBarOpacity}"
|
||||||
Opacity="0.2"
|
Value="{Binding LastPull}">
|
||||||
Value="{Binding LastPull}">
|
<ProgressBar.Foreground>
|
||||||
<ProgressBar.Foreground>
|
<SolidColorBrush Color="{Binding LastPull, Converter={StaticResource Int32ToGradientColorConverter}}"/>
|
||||||
<SolidColorBrush Color="{Binding LastPull, Converter={StaticResource Int32ToGradientColorConverter}}"/>
|
</ProgressBar.Foreground>
|
||||||
</ProgressBar.Foreground>
|
</ProgressBar>
|
||||||
</ProgressBar>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<shci:CachedImage
|
<shci:CachedImage
|
||||||
Width="32"
|
shvh:FrameworkElementHelper.SquareLength="32"
|
||||||
Height="32"
|
|
||||||
CornerRadius="{ThemeResource ControlCornerRadius}"
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||||
Source="{Binding Icon}"/>
|
Source="{Binding Icon}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Snap.Hutao.View.Helper;
|
|||||||
|
|
||||||
[SuppressMessage("", "SH001")]
|
[SuppressMessage("", "SH001")]
|
||||||
[DependencyProperty("SquareLength", typeof(double), 0D, nameof(OnSquareLengthChanged), IsAttached = true, AttachedType = typeof(Microsoft.UI.Xaml.Controls.Control))]
|
[DependencyProperty("SquareLength", typeof(double), 0D, nameof(OnSquareLengthChanged), IsAttached = true, AttachedType = typeof(Microsoft.UI.Xaml.Controls.Control))]
|
||||||
public sealed partial class ControlHelper
|
public sealed partial class FrameworkElementHelper
|
||||||
{
|
{
|
||||||
private static void OnSquareLengthChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
|
private static void OnSquareLengthChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
Reference in New Issue
Block a user