mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
static resouce download refactor and ui/ux improvement
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
x:Class="Snap.Hutao.App"
|
x:Class="Snap.Hutao.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:cwc="using:CommunityToolkit.WinUI.Converters"
|
xmlns:cwcont="using:CommunityToolkit.WinUI.Controls"
|
||||||
xmlns:cwcw="using:CommunityToolkit.WinUI.Controls"
|
xmlns:cwconv="using:CommunityToolkit.WinUI.Converters"
|
||||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||||
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"
|
||||||
@@ -120,9 +120,9 @@
|
|||||||
<x:String x:Key="FontIconContentAsteriskBadge12"></x:String>
|
<x:String x:Key="FontIconContentAsteriskBadge12"></x:String>
|
||||||
<x:String x:Key="FontIconContentZipFolder"></x:String>
|
<x:String x:Key="FontIconContentZipFolder"></x:String>
|
||||||
<!-- Converters -->
|
<!-- Converters -->
|
||||||
<cwc:BoolNegationConverter x:Key="BoolNegationConverter"/>
|
<cwconv:BoolNegationConverter x:Key="BoolNegationConverter"/>
|
||||||
<cwc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
<cwconv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||||
<cwc:FileSizeToFriendlyStringConverter x:Key="FileSizeToFriendlyStringConverter"/>
|
<cwconv:FileSizeToFriendlyStringConverter x:Key="FileSizeToFriendlyStringConverter"/>
|
||||||
<shmmc:AchievementIconConverter x:Key="AchievementIconConverter"/>
|
<shmmc:AchievementIconConverter x:Key="AchievementIconConverter"/>
|
||||||
<shmmc:AvatarCardConverter x:Key="AvatarCardConverter"/>
|
<shmmc:AvatarCardConverter x:Key="AvatarCardConverter"/>
|
||||||
<shmmc:AvatarIconConverter x:Key="AvatarIconConverter"/>
|
<shmmc:AvatarIconConverter x:Key="AvatarIconConverter"/>
|
||||||
@@ -178,11 +178,25 @@
|
|||||||
<Setter Property="BorderThickness" Value="1"/>
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
<Setter Property="CornerRadius" Value="{StaticResource CompatCornerRadius}"/>
|
<Setter Property="CornerRadius" Value="{StaticResource CompatCornerRadius}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style
|
||||||
|
x:Name="NoneSelectionListViewItemStyle"
|
||||||
|
BasedOn="{StaticResource DefaultListViewItemStyle}"
|
||||||
|
TargetType="ListViewItem">
|
||||||
|
<Setter Property="Padding" Value="0"/>
|
||||||
|
<Setter Property="Margin" Value="0,4,0,0"/>
|
||||||
|
</Style>
|
||||||
|
<Style
|
||||||
|
x:Name="NoneSelectionGridViewItemStyle"
|
||||||
|
BasedOn="{StaticResource DefaultGridViewItemStyle}"
|
||||||
|
TargetType="GridViewItem">
|
||||||
|
<Setter Property="Padding" Value="0"/>
|
||||||
|
<Setter Property="Margin" Value="0,0,2,4"/>
|
||||||
|
</Style>
|
||||||
<Style TargetType="shci:CachedImage">
|
<Style TargetType="shci:CachedImage">
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
|
<Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
|
||||||
<Setter Property="IsTabStop" Value="False"/>
|
<Setter Property="IsTabStop" Value="False"/>
|
||||||
<Setter Property="LazyLoadingThreshold" Value="300"/>
|
<Setter Property="LazyLoadingThreshold" Value="256"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="shci:CachedImage">
|
<ControlTemplate TargetType="shci:CachedImage">
|
||||||
@@ -259,16 +273,34 @@
|
|||||||
<ItemsPanelTemplate x:Key="ItemsStackPanelTemplate">
|
<ItemsPanelTemplate x:Key="ItemsStackPanelTemplate">
|
||||||
<ItemsStackPanel/>
|
<ItemsStackPanel/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
<ItemsPanelTemplate x:Key="WrapPanelTemplate">
|
<ItemsPanelTemplate x:Key="WrapPanelSpacing0Template">
|
||||||
<cwcw:WrapPanel/>
|
<cwcont:WrapPanel/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
<ItemsPanelTemplate x:Key="WrapPanelSpacing4Template">
|
||||||
|
<cwcont:WrapPanel HorizontalSpacing="4" VerticalSpacing="4"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
<ItemsPanelTemplate x:Key="HorizontalStackPanelTemplate">
|
<ItemsPanelTemplate x:Key="HorizontalStackPanelTemplate">
|
||||||
<StackPanel Orientation="Horizontal"/>
|
<StackPanel Orientation="Horizontal"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
|
<ItemsPanelTemplate x:Key="UniformGridColumns5Spacing4Template">
|
||||||
|
<cwcont:UniformGrid
|
||||||
|
ColumnSpacing="4"
|
||||||
|
Columns="5"
|
||||||
|
RowSpacing="4"/>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
<!-- Transitions -->
|
<!-- Transitions -->
|
||||||
<TransitionCollection x:Key="ReorderThemeTransitions">
|
<TransitionCollection x:Key="ReorderThemeTransitions">
|
||||||
<ReorderThemeTransition/>
|
<ReorderThemeTransition/>
|
||||||
</TransitionCollection>
|
</TransitionCollection>
|
||||||
|
<TransitionCollection x:Key="ContentThemeTransitions">
|
||||||
|
<ContentThemeTransition/>
|
||||||
|
</TransitionCollection>
|
||||||
|
<TransitionCollection x:Key="ListViewLikeThemeTransitions">
|
||||||
|
<AddDeleteThemeTransition/>
|
||||||
|
<ContentThemeTransition/>
|
||||||
|
<ReorderThemeTransition/>
|
||||||
|
<EntranceThemeTransition IsStaggeringEnabled="False"/>
|
||||||
|
</TransitionCollection>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
@@ -12,7 +12,6 @@ internal sealed class Int32Extension : MarkupExtension
|
|||||||
|
|
||||||
protected override object ProvideValue()
|
protected override object ProvideValue()
|
||||||
{
|
{
|
||||||
_ = int.TryParse(Value, out int result);
|
return XamlBindingHelper.ConvertValue(typeof(int), Value);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,6 +141,11 @@ internal sealed partial class Activation : IActivation
|
|||||||
// Increase launch times
|
// Increase launch times
|
||||||
LocalSetting.Set(SettingKeys.LaunchTimes, LocalSetting.Get(SettingKeys.LaunchTimes, 0) + 1);
|
LocalSetting.Set(SettingKeys.LaunchTimes, LocalSetting.Get(SettingKeys.LaunchTimes, 0) + 1);
|
||||||
|
|
||||||
|
if (StaticResource.IsAnyUnfulfilledCategoryPresent())
|
||||||
|
{
|
||||||
|
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.StaticResourceBegin);
|
||||||
|
}
|
||||||
|
|
||||||
if (LocalSetting.Get(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.Language) < (uint)GuideState.Completed)
|
if (LocalSetting.Get(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.Language) < (uint)GuideState.Completed)
|
||||||
{
|
{
|
||||||
await taskContext.SwitchToMainThreadAsync();
|
await taskContext.SwitchToMainThreadAsync();
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
namespace Snap.Hutao.Core.Setting;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 静态资源
|
|
||||||
/// </summary>
|
|
||||||
[HighQuality]
|
|
||||||
internal static class StaticResource
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 静态资源合约
|
|
||||||
/// </summary>
|
|
||||||
public const string V1Contract = "StaticResourceV1Contract";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 静态资源合约V2 成就图标与物品图标
|
|
||||||
/// </summary>
|
|
||||||
public const string V2Contract = "StaticResourceV2Contract";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 静态资源合约V3 刷新 Skill Talent
|
|
||||||
/// </summary>
|
|
||||||
public const string V3Contract = "StaticResourceV3Contract";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 静态资源合约V4 刷新 AvatarIcon
|
|
||||||
/// </summary>
|
|
||||||
public const string V4Contract = "StaticResourceV4Contract";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 静态资源合约V5 刷新 AvatarIcon
|
|
||||||
/// </summary>
|
|
||||||
public const string V5Contract = "StaticResourceV5Contract";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 完成所有合约
|
|
||||||
/// </summary>
|
|
||||||
public static void FulfillAllContracts()
|
|
||||||
{
|
|
||||||
SetContractsState(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 取消完成所有合约
|
|
||||||
/// </summary>
|
|
||||||
public static void FailAllContracts()
|
|
||||||
{
|
|
||||||
SetContractsState(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提供的合约是否未完成
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="contractKey">合约的键</param>
|
|
||||||
/// <returns>合约是否未完成</returns>
|
|
||||||
public static bool IsContractUnfulfilled(string contractKey)
|
|
||||||
{
|
|
||||||
return !LocalSetting.Get(contractKey, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否有任何静态资源合约尚未完成
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>静态资源合约尚未完成</returns>
|
|
||||||
public static bool IsAnyUnfulfilledContractPresent()
|
|
||||||
{
|
|
||||||
return !LocalSetting.Get(V1Contract, false)
|
|
||||||
|| (!LocalSetting.Get(V2Contract, false))
|
|
||||||
|| (!LocalSetting.Get(V3Contract, false))
|
|
||||||
|| (!LocalSetting.Get(V4Contract, false))
|
|
||||||
|| (!LocalSetting.Get(V5Contract, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetContractsState(bool state)
|
|
||||||
{
|
|
||||||
LocalSetting.Set(V1Contract, state);
|
|
||||||
LocalSetting.Set(V2Contract, state);
|
|
||||||
LocalSetting.Set(V3Contract, state);
|
|
||||||
LocalSetting.Set(V4Contract, state);
|
|
||||||
LocalSetting.Set(V5Contract, state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,8 +13,8 @@ namespace Snap.Hutao;
|
|||||||
[Injection(InjectAs.Singleton)]
|
[Injection(InjectAs.Singleton)]
|
||||||
internal sealed partial class GuideWindow : Window, IWindowOptionsSource
|
internal sealed partial class GuideWindow : Window, IWindowOptionsSource
|
||||||
{
|
{
|
||||||
private const int MinWidth = 800;
|
private const int MinWidth = 1000;
|
||||||
private const int MinHeight = 450;
|
private const int MinHeight = 600;
|
||||||
|
|
||||||
private const int MaxWidth = 1200;
|
private const int MaxWidth = 1200;
|
||||||
private const int MaxHeight = 750;
|
private const int MaxHeight = 750;
|
||||||
|
|||||||
@@ -114,7 +114,6 @@
|
|||||||
<None Remove="View\Card\Primitive\CardProgressBar.xaml" />
|
<None Remove="View\Card\Primitive\CardProgressBar.xaml" />
|
||||||
<None Remove="View\Control\BaseValueSlider.xaml" />
|
<None Remove="View\Control\BaseValueSlider.xaml" />
|
||||||
<None Remove="View\Control\BottomTextControl.xaml" />
|
<None Remove="View\Control\BottomTextControl.xaml" />
|
||||||
<None Remove="View\Control\BottomTextSmallControl.xaml" />
|
|
||||||
<None Remove="View\Control\DescParamComboBox.xaml" />
|
<None Remove="View\Control\DescParamComboBox.xaml" />
|
||||||
<None Remove="View\Control\Elevation.xaml" />
|
<None Remove="View\Control\Elevation.xaml" />
|
||||||
<None Remove="View\Control\HutaoStatisticsCard.xaml" />
|
<None Remove="View\Control\HutaoStatisticsCard.xaml" />
|
||||||
@@ -348,12 +347,6 @@
|
|||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Page Update="View\Control\BottomTextSmallControl.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="GuideWindow.xaml">
|
<Page Update="GuideWindow.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -11,7 +11,14 @@
|
|||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
|
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
|
||||||
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="BaseValueTemplate">
|
||||||
|
<cwc:SettingsCard Margin="0,2,0,0" Header="{Binding Name}">
|
||||||
|
<TextBlock Text="{Binding Value}"/>
|
||||||
|
</cwc:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<StackPanel VerticalAlignment="Top">
|
<StackPanel VerticalAlignment="Top">
|
||||||
<cwc:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
|
<cwc:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
|
||||||
@@ -41,14 +48,9 @@
|
|||||||
</cwc:SettingsCard>
|
</cwc:SettingsCard>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind BaseValueInfo.Values, Mode=OneWay}">
|
<ItemsControl
|
||||||
<ItemsControl.ItemTemplate>
|
VerticalAlignment="Top"
|
||||||
<DataTemplate>
|
ItemTemplate="{StaticResource BaseValueTemplate}"
|
||||||
<cwc:SettingsCard Margin="0,2,0,0" Header="{Binding Name}">
|
ItemsSource="{x:Bind BaseValueInfo.Values, Mode=OneWay}"/>
|
||||||
<TextBlock Text="{Binding Value}"/>
|
|
||||||
</cwc:SettingsCard>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<ContentControl
|
<UserControl
|
||||||
x:Class="Snap.Hutao.View.Control.BottomTextControl"
|
x:Class="Snap.Hutao.View.Control.BottomTextControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:cw="using:CommunityToolkit.WinUI"
|
xmlns:cw="using:CommunityToolkit.WinUI"
|
||||||
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"
|
||||||
|
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Border Style="{StaticResource BorderCardStyle}">
|
||||||
@@ -15,13 +16,15 @@
|
|||||||
Content="{x:Bind TopContent, Mode=OneWay}"/>
|
Content="{x:Bind TopContent, Mode=OneWay}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
MaxWidth="{x:Bind ContentHost.(cw:FrameworkElementExtensions.ActualWidth), Mode=OneWay}"
|
MaxWidth="{x:Bind ContentHost.(cw:FrameworkElementExtensions.ActualWidth), Mode=OneWay}"
|
||||||
Margin="0,0,0,2"
|
Margin="0,1"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
Foreground="{x:Bind Foreground}"
|
||||||
HorizontalTextAlignment="Center"
|
HorizontalTextAlignment="Center"
|
||||||
|
Style="{x:Bind TextStyle, Mode=OneWay}"
|
||||||
Text="{x:Bind Text, Mode=OneWay}"
|
Text="{x:Bind Text, Mode=OneWay}"
|
||||||
TextTrimming="CharacterEllipsis"
|
TextTrimming="CharacterEllipsis"
|
||||||
TextWrapping="NoWrap"/>
|
TextWrapping="NoWrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</ContentControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -14,15 +14,17 @@ namespace Snap.Hutao.View.Control;
|
|||||||
[HighQuality]
|
[HighQuality]
|
||||||
[ContentProperty(Name = nameof(TopContent))]
|
[ContentProperty(Name = nameof(TopContent))]
|
||||||
[DependencyProperty("Text", typeof(string), "")]
|
[DependencyProperty("Text", typeof(string), "")]
|
||||||
|
[DependencyProperty("TextStyle", typeof(Style))]
|
||||||
[DependencyProperty("Fill", typeof(Brush), default!)]
|
[DependencyProperty("Fill", typeof(Brush), default!)]
|
||||||
[DependencyProperty("TopContent", typeof(FrameworkElement), default!)]
|
[DependencyProperty("TopContent", typeof(FrameworkElement), default!)]
|
||||||
internal sealed partial class BottomTextControl : ContentControl
|
internal sealed partial class BottomTextControl : UserControl
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造一个新的底部带有文本的控件
|
/// 构造一个新的底部带有文本的控件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BottomTextControl()
|
public BottomTextControl()
|
||||||
{
|
{
|
||||||
|
TextStyle = Ioc.Default.GetRequiredService<IAppResourceProvider>().GetResource<Style>("BodyTextBlockStyle");
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<UserControl
|
|
||||||
x:Class="Snap.Hutao.View.Control.BottomTextSmallControl"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
|
||||||
<StackPanel Background="{x:Bind Background, Mode=OneWay}">
|
|
||||||
<ContentPresenter Content="{x:Bind TopContent, Mode=OneWay}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Foreground="{x:Bind Foreground, Mode=OneWay}"
|
|
||||||
HorizontalTextAlignment="Center"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{x:Bind Text, Mode=OneWay}"
|
|
||||||
TextTrimming="CharacterEllipsis"
|
|
||||||
TextWrapping="NoWrap"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Microsoft.UI.Xaml.Markup;
|
|
||||||
|
|
||||||
namespace Snap.Hutao.View.Control;
|
|
||||||
|
|
||||||
[ContentProperty(Name = nameof(TopContent))]
|
|
||||||
[DependencyProperty("Text", typeof(string), "")]
|
|
||||||
[DependencyProperty("TopContent", typeof(FrameworkElement), default!)]
|
|
||||||
internal sealed partial class BottomTextSmallControl : UserControl
|
|
||||||
{
|
|
||||||
public BottomTextSmallControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,41 +6,34 @@
|
|||||||
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:shcm="using:Snap.Hutao.Control.Markup"
|
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||||
|
xmlns:shmm="using:Snap.Hutao.Model.Metadata"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
|
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
|
||||||
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="ParameterDescriptionTemplate" x:DataType="shmm:ParameterDescription">
|
||||||
|
<cwc:SettingsCard Margin="0,3,0,0" Header="{Binding Description}">
|
||||||
|
<TextBlock Text="{Binding Parameter}"/>
|
||||||
|
</cwc:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<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
|
||||||
|
DisplayMemberPath="Level"
|
||||||
ItemsSource="{x:Bind Source, Mode=OneWay}"
|
ItemsSource="{x:Bind Source, Mode=OneWay}"
|
||||||
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
|
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
|
||||||
Style="{StaticResource SettingsContentComboBoxStyle}">
|
Style="{StaticResource SettingsContentComboBoxStyle}"/>
|
||||||
<ComboBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding Level}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
</cwc:SettingsCard>
|
</cwc:SettingsCard>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind SelectedItem.Parameters, Mode=OneWay}">
|
<ItemsControl
|
||||||
<ItemsControl.ItemContainerTransitions>
|
VerticalAlignment="Top"
|
||||||
<TransitionCollection>
|
ItemContainerTransitions="{StaticResource ContentThemeTransitions}"
|
||||||
<ContentThemeTransition/>
|
ItemTemplate="{StaticResource ParameterDescriptionTemplate}"
|
||||||
</TransitionCollection>
|
ItemsSource="{x:Bind SelectedItem.Parameters, Mode=OneWay}"/>
|
||||||
</ItemsControl.ItemContainerTransitions>
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<cwc:SettingsCard Margin="0,3,0,0" Header="{Binding Description}">
|
|
||||||
<TextBlock Text="{Binding Parameter}"/>
|
|
||||||
</cwc:SettingsCard>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -15,80 +15,67 @@
|
|||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<DataTemplate x:Key="GridTemplate" d:DataType="shvg:StatisticsItem">
|
<DataTemplate x:Key="GridTemplate" d:DataType="shvg:StatisticsItem">
|
||||||
<Border
|
<shvcont:BottomTextControl Text="{Binding Count}" TextStyle="{StaticResource CaptionTextBlockStyle}">
|
||||||
Width="40"
|
<shvcont:ItemIcon
|
||||||
Margin="0,4,4,0"
|
shch:FrameworkElementHelper.SquareLength="40"
|
||||||
Style="{StaticResource BorderCardStyle}">
|
Icon="{Binding Icon}"
|
||||||
<StackPanel>
|
Quality="{Binding Quality}"/>
|
||||||
<shvcont:ItemIcon
|
</shvcont:BottomTextControl>
|
||||||
shch:FrameworkElementHelper.SquareLength="40"
|
|
||||||
Icon="{Binding Icon}"
|
|
||||||
Quality="{Binding Quality}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalTextAlignment="Center"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{Binding Count}"
|
|
||||||
TextTrimming="None"
|
|
||||||
TextWrapping="NoWrap"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Grid Style="{StaticResource BorderGridStyle}">
|
||||||
<Grid>
|
<Grid.RowDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<RowDefinition Height="auto"/>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition/>
|
||||||
<RowDefinition/>
|
</Grid.RowDefinitions>
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
CornerRadius="{StaticResource CompatCornerRadiusTop}"
|
CornerRadius="{StaticResource CompatCornerRadiusTop}"
|
||||||
Style="{StaticResource BorderGridStyle}">
|
Style="{StaticResource BorderGridStyle}">
|
||||||
<shcp:AspectRatio TargetHeight="320" TargetWidth="690"/>
|
<shcp:AspectRatio TargetHeight="320" TargetWidth="690"/>
|
||||||
<shci:CachedImage Source="{Binding Event.Banner}"/>
|
<shci:CachedImage Source="{Binding Event.Banner}"/>
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<ScrollViewer Grid.Row="1">
|
|
||||||
<StackPanel Margin="16,0,12,16">
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,16,0,8"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpText}"/>
|
|
||||||
<ItemsControl
|
|
||||||
ItemTemplate="{StaticResource GridTemplate}"
|
|
||||||
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
|
||||||
ItemsSource="{Binding UpItems}"/>
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,16,0,8"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
|
|
||||||
<ItemsControl
|
|
||||||
ItemTemplate="{StaticResource GridTemplate}"
|
|
||||||
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
|
||||||
ItemsSource="{Binding OrangeItems}"/>
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,16,0,8"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
|
|
||||||
<ItemsControl
|
|
||||||
ItemTemplate="{StaticResource GridTemplate}"
|
|
||||||
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
|
||||||
ItemsSource="{Binding PurpleItems}"/>
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,16,0,8"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>
|
|
||||||
<ItemsControl
|
|
||||||
ItemTemplate="{StaticResource GridTemplate}"
|
|
||||||
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
|
||||||
ItemsSource="{Binding BlueItems}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
|
||||||
|
<ScrollViewer Grid.Row="1">
|
||||||
|
<StackPanel Margin="16,0,12,16">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,16,0,8"
|
||||||
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpText}"/>
|
||||||
|
<ItemsControl
|
||||||
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
|
ItemsPanel="{StaticResource WrapPanelSpacing4Template}"
|
||||||
|
ItemsSource="{Binding UpItems}"/>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,16,0,8"
|
||||||
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
|
||||||
|
<ItemsControl
|
||||||
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
|
ItemsPanel="{StaticResource WrapPanelSpacing4Template}"
|
||||||
|
ItemsSource="{Binding OrangeItems}"/>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,16,0,8"
|
||||||
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
|
||||||
|
<ItemsControl
|
||||||
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
|
ItemsPanel="{StaticResource WrapPanelSpacing4Template}"
|
||||||
|
ItemsSource="{Binding PurpleItems}"/>
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,16,0,8"
|
||||||
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>
|
||||||
|
<ItemsControl
|
||||||
|
ItemTemplate="{StaticResource GridTemplate}"
|
||||||
|
ItemsPanel="{StaticResource WrapPanelSpacing4Template}"
|
||||||
|
ItemsSource="{Binding BlueItems}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -19,11 +19,10 @@
|
|||||||
<shci:CachedImage EnableLazyLoading="False" Source="{StaticResource UI_ImgSign_ItemIcon}"/>
|
<shci:CachedImage EnableLazyLoading="False" Source="{StaticResource UI_ImgSign_ItemIcon}"/>
|
||||||
<shci:CachedImage Source="{x:Bind Icon, Mode=OneWay}"/>
|
<shci:CachedImage Source="{x:Bind Icon, Mode=OneWay}"/>
|
||||||
<shci:CachedImage
|
<shci:CachedImage
|
||||||
Width="16"
|
|
||||||
Height="16"
|
|
||||||
Margin="2"
|
Margin="2"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
|
shch:FrameworkElementHelper.SquareLength="16"
|
||||||
EnableLazyLoading="False"
|
EnableLazyLoading="False"
|
||||||
Source="{x:Bind Badge, Mode=OneWay}"/>
|
Source="{x:Bind Badge, Mode=OneWay}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -11,6 +11,50 @@
|
|||||||
IsExpanded="True"
|
IsExpanded="True"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Expander.Resources>
|
||||||
|
<DataTemplate x:Key="VoicePackageTemplate" x:DataType="shwhshl:VoicePackage">
|
||||||
|
<Grid Margin="0,16,0,0">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Text="{Binding DisplayName}"/>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0,4,0,0"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentZipFolder}"/>
|
||||||
|
<TextBlock
|
||||||
|
Width="80"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{Binding PackageSize, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
||||||
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentFolder}"/>
|
||||||
|
<TextBlock
|
||||||
|
Width="80"
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{Binding Size, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
||||||
|
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentAsteriskBadge12}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="8,0,0,0"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{Binding Md5}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<HyperlinkButton
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
Height="38.4"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Content=""
|
||||||
|
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||||
|
NavigateUri="{Binding Path}"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</Expander.Resources>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="auto"/>
|
||||||
@@ -52,50 +96,9 @@
|
|||||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||||
NavigateUri="{Binding Path}"/>
|
NavigateUri="{Binding Path}"/>
|
||||||
<MenuFlyoutSeparator Grid.Row="2" Margin="4,16,4,0"/>
|
<MenuFlyoutSeparator Grid.Row="2" Margin="4,16,4,0"/>
|
||||||
<ItemsControl Grid.Row="3" ItemsSource="{Binding VoicePacks}">
|
<ItemsControl
|
||||||
<ItemsControl.ItemTemplate>
|
Grid.Row="3"
|
||||||
<DataTemplate>
|
ItemTemplate="{StaticResource VoicePackageTemplate}"
|
||||||
<Grid Margin="0,16,0,0">
|
ItemsSource="{Binding VoicePacks}"/>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Text="{Binding DisplayName}"/>
|
|
||||||
<StackPanel
|
|
||||||
Grid.Row="1"
|
|
||||||
Margin="0,4,0,0"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentZipFolder}"/>
|
|
||||||
<TextBlock
|
|
||||||
Width="80"
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{Binding PackageSize, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentFolder}"/>
|
|
||||||
<TextBlock
|
|
||||||
Width="80"
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{Binding Size, Converter={StaticResource FileSizeToFriendlyStringConverter}}"/>
|
|
||||||
<FontIcon FontSize="{StaticResource CaptionTextBlockFontSize}" Glyph="{StaticResource FontIconContentAsteriskBadge12}"/>
|
|
||||||
<TextBlock
|
|
||||||
Margin="8,0,0,0"
|
|
||||||
IsTextSelectionEnabled="True"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{Binding Md5}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<HyperlinkButton
|
|
||||||
Grid.RowSpan="2"
|
|
||||||
Height="38.4"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Content=""
|
|
||||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
|
||||||
NavigateUri="{Binding Path}"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Expander>
|
</Expander>
|
||||||
|
|||||||
@@ -15,25 +15,24 @@
|
|||||||
<Style BasedOn="{StaticResource DefaultPivotHeaderItemStyle}" TargetType="PivotHeaderItem">
|
<Style BasedOn="{StaticResource DefaultPivotHeaderItemStyle}" TargetType="PivotHeaderItem">
|
||||||
<Setter Property="Height" Value="80"/>
|
<Setter Property="Height" Value="80"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="SkillHeaderTemplate">
|
||||||
|
<StackPanel>
|
||||||
|
<shci:MonoChrome shch:FrameworkElementHelper.SquareLength="36" Source="{Binding Icon, Converter={StaticResource SkillIconConverter}}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,8,0,0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{Binding Name}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Pivot
|
<Pivot
|
||||||
x:Name="ItemHost"
|
HeaderTemplate="{StaticResource SkillHeaderTemplate}"
|
||||||
ItemTemplate="{x:Bind ItemTemplate}"
|
ItemTemplate="{x:Bind ItemTemplate}"
|
||||||
ItemsSource="{x:Bind Skills, Mode=OneWay}"
|
ItemsSource="{x:Bind Skills, Mode=OneWay}"
|
||||||
SelectedItem="{x:Bind Selected}"
|
SelectedItem="{x:Bind Selected}"
|
||||||
Style="{StaticResource DefaultPivotStyle}">
|
Style="{StaticResource DefaultPivotStyle}"/>
|
||||||
<Pivot.HeaderTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<StackPanel>
|
|
||||||
<shci:MonoChrome shch:FrameworkElementHelper.SquareLength="36" Source="{Binding Icon, Converter={StaticResource SkillIconConverter}}"/>
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,8,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{Binding Name}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</Pivot.HeaderTemplate>
|
|
||||||
</Pivot>
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -12,6 +12,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:shvconv="using:Snap.Hutao.View.Converter"
|
xmlns:shvconv="using:Snap.Hutao.View.Converter"
|
||||||
|
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
|
||||||
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
||||||
d:DataContext="{d:DesignInstance shvg:TypedWishSummary}"
|
d:DataContext="{d:DesignInstance shvg:TypedWishSummary}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
@@ -84,287 +85,235 @@
|
|||||||
TrueValue="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
|
TrueValue="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
|
||||||
|
|
||||||
<DataTemplate x:Key="OrangeGridTemplate" d:DataType="shvg:SummaryItem">
|
<DataTemplate x:Key="OrangeGridTemplate" d:DataType="shvg:SummaryItem">
|
||||||
<shvcont:BottomTextSmallControl
|
<shvcont:BottomTextControl
|
||||||
Background="{Binding IsUp, Converter={StaticResource BoolToBrushConverter}}"
|
Background="{Binding IsUp, Converter={StaticResource BoolToBrushConverter}}"
|
||||||
Text="{Binding LastPull}"
|
Text="{Binding LastPull}"
|
||||||
|
TextStyle="{StaticResource CaptionTextBlockStyle}"
|
||||||
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
||||||
<shvcont:BottomTextSmallControl.Foreground>
|
<shvcont:BottomTextControl.Foreground>
|
||||||
<SolidColorBrush Color="{Binding Color}"/>
|
<SolidColorBrush Color="{Binding Color}"/>
|
||||||
</shvcont:BottomTextSmallControl.Foreground>
|
</shvcont:BottomTextControl.Foreground>
|
||||||
<shvcont:ItemIcon
|
<shvcont:ItemIcon
|
||||||
shch:FrameworkElementHelper.SquareLength="40"
|
shch:FrameworkElementHelper.SquareLength="40"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
Quality="{Binding Quality}"/>
|
Quality="{Binding Quality}"/>
|
||||||
</shvcont:BottomTextSmallControl>
|
</shvcont:BottomTextControl>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Grid Style="{StaticResource BorderGridStyle}">
|
||||||
<Grid>
|
<Grid.RowDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<RowDefinition Height="auto"/>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="auto"/>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition/>
|
||||||
<RowDefinition/>
|
</Grid.RowDefinitions>
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Expander
|
<Expander
|
||||||
x:Name="DetailExpander"
|
x:Name="DetailExpander"
|
||||||
Padding="16,0,16,0"
|
Padding="16,0,16,0"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="{x:Null}"
|
BorderBrush="{x:Null}"
|
||||||
BorderThickness="0"
|
BorderThickness="0"
|
||||||
CornerRadius="4,4,0,0"
|
CornerRadius="4,4,0,0"
|
||||||
IsExpanded="True">
|
IsExpanded="True">
|
||||||
<Expander.Resources>
|
<Expander.Resources>
|
||||||
<Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,1</Thickness>
|
<Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,1</Thickness>
|
||||||
</Expander.Resources>
|
</Expander.Resources>
|
||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{Binding Name}"
|
||||||
|
TextTrimming="CharacterEllipsis"
|
||||||
|
TextWrapping="NoWrap"/>
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="0,0,-12,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,6,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="20"
|
||||||
|
Text="{Binding TotalCountFormatted}"
|
||||||
|
Visibility="{x:Bind DetailExpander.IsExpanded, Converter={StaticResource BoolToVisibilityRevertConverter}, Mode=OneWay}"/>
|
||||||
|
<shcp:PanelSelector
|
||||||
|
x:Name="ItemsPanelSelector"
|
||||||
|
Margin="6,0,0,0"
|
||||||
|
Current="Grid"
|
||||||
|
Visibility="{x:Bind DetailExpander.IsExpanded, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Expander.Header>
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<StackPanel Grid.Row="1" Margin="0,0,0,12">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,4,0,4"
|
||||||
|
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
||||||
|
FontSize="48"
|
||||||
|
Text="{Binding TotalCount}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="12,0,0,12"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPullText}"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="4">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock
|
<shvcp:CardProgressBar
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
MinHeight="32"
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
Description="{Binding LastOrangePull}"
|
||||||
Text="{Binding Name}"
|
Header="{shcm:ResourceString Name=ViewControlStatisticsCardToLastOrangeText}"
|
||||||
TextTrimming="CharacterEllipsis"
|
Maximum="{Binding GuaranteeOrangeThreshold}"
|
||||||
TextWrapping="NoWrap"/>
|
ProgressForeground="{StaticResource OrangeBrush}"
|
||||||
<StackPanel
|
TextForeground="{StaticResource OrangeBrush}"
|
||||||
|
Value="{Binding LastOrangePull}"/>
|
||||||
|
<shvcp:CardProgressBar
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="0,0,-12,0"
|
MinHeight="32"
|
||||||
HorizontalAlignment="Right"
|
Description="{Binding LastPurplePull}"
|
||||||
Orientation="Horizontal">
|
Header="{shcm:ResourceString Name=ViewControlStatisticsCardToLastPurpleText}"
|
||||||
<TextBlock
|
Maximum="{Binding GuaranteePurpleThreshold}"
|
||||||
Margin="0,0,6,0"
|
ProgressForeground="{StaticResource PurpleBrush}"
|
||||||
VerticalAlignment="Center"
|
TextForeground="{StaticResource PurpleBrush}"
|
||||||
FontSize="20"
|
Value="{Binding LastPurplePull}"/>
|
||||||
Text="{Binding TotalCountFormatted}"
|
|
||||||
Visibility="{x:Bind DetailExpander.IsExpanded, Converter={StaticResource BoolToVisibilityRevertConverter}, Mode=OneWay}"/>
|
|
||||||
<shcp:PanelSelector
|
|
||||||
x:Name="ItemsPanelSelector"
|
|
||||||
Margin="6,0,0,0"
|
|
||||||
Current="Grid"
|
|
||||||
Visibility="{x:Bind DetailExpander.IsExpanded, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Expander.Header>
|
|
||||||
|
|
||||||
<StackPanel>
|
|
||||||
<StackPanel Grid.Row="1" Margin="0,0,0,12">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,4,0,4"
|
|
||||||
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
|
||||||
FontSize="48"
|
|
||||||
Text="{Binding TotalCount}"/>
|
|
||||||
<TextBlock
|
|
||||||
Margin="12,0,0,12"
|
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPullText}"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Grid ColumnSpacing="4">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid Grid.Column="0" Style="{StaticResource BorderGridStyle}">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ProgressBar
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
MinHeight="32"
|
|
||||||
Background="Transparent"
|
|
||||||
Foreground="{StaticResource OrangeBrush}"
|
|
||||||
Maximum="{Binding GuaranteeOrangeThreshold}"
|
|
||||||
Opacity="{StaticResource LargeBackgroundProgressBarOpacity}"
|
|
||||||
Value="{Binding LastOrangePull}"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="6,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Foreground="{StaticResource OrangeBrush}"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardToLastOrangeText}"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="1"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Foreground="{StaticResource OrangeBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding LastOrangePull}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid Grid.Column="1" Style="{StaticResource BorderGridStyle}">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ProgressBar
|
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
MinHeight="32"
|
|
||||||
Background="Transparent"
|
|
||||||
Foreground="{StaticResource PurpleBrush}"
|
|
||||||
Maximum="{Binding GuaranteePurpleThreshold}"
|
|
||||||
Opacity="{StaticResource LargeBackgroundProgressBarOpacity}"
|
|
||||||
Value="{Binding LastPurplePull}"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="6,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Foreground="{StaticResource PurpleBrush}"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardToLastPurpleText}"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="1"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Foreground="{StaticResource PurpleBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding LastPurplePull}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
<MenuFlyoutSeparator Margin="-12,0"/>
|
|
||||||
<shvcont:StatisticsSegmented
|
|
||||||
x:Name="StatisticsSegmented"
|
|
||||||
Margin="0,12,0,0"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
IsPredictPullAvailable="{Binding IsPredictPullAvailable}"
|
|
||||||
SelectedIndex="0"/>
|
|
||||||
<cwcont:SwitchPresenter
|
|
||||||
Height="85"
|
|
||||||
Padding="0,12"
|
|
||||||
Value="{x:Bind StatisticsSegmented.SelectedIndex, Mode=OneWay}">
|
|
||||||
<cwcont:Case Value="{shcm:Int32 Value=0}">
|
|
||||||
<StackPanel Spacing="2">
|
|
||||||
<Grid>
|
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeAveragePullText}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding AverageOrangePullFormatted}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<TextBlock/>
|
|
||||||
<TextBlock
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpAveragePullText}"
|
|
||||||
Visibility="{x:Bind ShowUpPull, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding AverageUpOrangePullFormatted}"
|
|
||||||
Visibility="{x:Bind ShowUpPull, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding MaxOrangePullFormatted}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding MinOrangePullFormatted}"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</cwcont:Case>
|
|
||||||
<cwcont:Case Value="{shcm:Int32 Value=1}">
|
|
||||||
<StackPanel Spacing="2">
|
|
||||||
<Grid>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{StaticResource OrangeBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
|
||||||
Foreground="{StaticResource OrangeBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding TotalOrangeFormatted}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{StaticResource PurpleBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
|
||||||
Foreground="{StaticResource PurpleBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding TotalPurpleFormatted}"/>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<TextBlock
|
|
||||||
Foreground="{StaticResource BlueBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>
|
|
||||||
<TextBlock
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
|
||||||
Foreground="{StaticResource BlueBrush}"
|
|
||||||
Style="{StaticResource BodyTextBlockStyle}"
|
|
||||||
Text="{Binding TotalBlueFormatted}"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</cwcont:Case>
|
|
||||||
<cwcont:Case Value="{shcm:Int32 Value=2}">
|
|
||||||
<StackPanel Spacing="2">
|
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{Binding PredictedPullLeftToOrangeFormatted}"/>
|
|
||||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{Binding ProbabilityOfNextPullIsOrangeFormatted}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</cwcont:Case>
|
|
||||||
</cwcont:SwitchPresenter>
|
|
||||||
<MenuFlyoutSeparator Margin="-12,0,-12,0"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<MenuFlyoutSeparator Margin="-12,0"/>
|
||||||
|
<shvcont:StatisticsSegmented
|
||||||
|
x:Name="StatisticsSegmented"
|
||||||
|
Margin="0,12,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
IsPredictPullAvailable="{Binding IsPredictPullAvailable}"
|
||||||
|
SelectedIndex="0"/>
|
||||||
|
<cwcont:SwitchPresenter
|
||||||
|
Height="85"
|
||||||
|
Padding="0,12"
|
||||||
|
Value="{x:Bind StatisticsSegmented.SelectedIndex, Mode=OneWay}">
|
||||||
|
<cwcont:Case Value="{shcm:Int32 Value=0}">
|
||||||
|
<StackPanel Spacing="2">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeAveragePullText}"/>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding AverageOrangePullFormatted}"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<TextBlock/>
|
||||||
|
<TextBlock
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpAveragePullText}"
|
||||||
|
Visibility="{x:Bind ShowUpPull, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding AverageUpOrangePullFormatted}"
|
||||||
|
Visibility="{x:Bind ShowUpPull, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding MaxOrangePullFormatted}"/>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding MinOrangePullFormatted}"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</cwcont:Case>
|
||||||
|
<cwcont:Case Value="{shcm:Int32 Value=1}">
|
||||||
|
<StackPanel Spacing="2">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{StaticResource OrangeBrush}"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
||||||
|
Foreground="{StaticResource OrangeBrush}"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding TotalOrangeFormatted}"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{StaticResource PurpleBrush}"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
||||||
|
Foreground="{StaticResource PurpleBrush}"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding TotalPurpleFormatted}"/>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{StaticResource BlueBrush}"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>
|
||||||
|
<TextBlock
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
FontFamily="{StaticResource CascadiaMonoAndMiSans}"
|
||||||
|
Foreground="{StaticResource BlueBrush}"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}"
|
||||||
|
Text="{Binding TotalBlueFormatted}"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</cwcont:Case>
|
||||||
|
<cwcont:Case Value="{shcm:Int32 Value=2}">
|
||||||
|
<StackPanel Spacing="2">
|
||||||
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{Binding PredictedPullLeftToOrangeFormatted}"/>
|
||||||
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{Binding ProbabilityOfNextPullIsOrangeFormatted}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</cwcont:Case>
|
||||||
|
</cwcont:SwitchPresenter>
|
||||||
|
<MenuFlyoutSeparator Margin="-12,0"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Expander>
|
||||||
|
|
||||||
|
<cwcont:SwitchPresenter
|
||||||
|
Grid.Row="2"
|
||||||
|
Margin="12,6,12,12"
|
||||||
|
ContentTransitions="{StaticResource ContentThemeTransitions}"
|
||||||
|
Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||||
|
|
||||||
|
<cwcont:Case Value="List">
|
||||||
|
<ListView
|
||||||
|
ItemContainerStyle="{StaticResource NoneSelectionListViewItemStyle}"
|
||||||
|
ItemTemplate="{StaticResource OrangeListTemplate}"
|
||||||
|
ItemsSource="{Binding OrangeList}"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||||
|
SelectionMode="None"/>
|
||||||
|
</cwcont:Case>
|
||||||
|
<cwcont:Case Value="Grid">
|
||||||
|
<GridView
|
||||||
|
Margin="0,0,-4,0"
|
||||||
|
ItemContainerStyle="{StaticResource NoneSelectionGridViewItemStyle}"
|
||||||
|
ItemTemplate="{StaticResource OrangeGridTemplate}"
|
||||||
|
ItemsSource="{Binding OrangeList}"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||||
|
SelectionMode="None"/>
|
||||||
|
</cwcont:Case>
|
||||||
|
</cwcont:SwitchPresenter>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
</Expander>
|
|
||||||
<cwcont:SwitchPresenter
|
|
||||||
Grid.Row="2"
|
|
||||||
Margin="12,6,12,12"
|
|
||||||
Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
|
||||||
<cwcont:SwitchPresenter.ContentTransitions>
|
|
||||||
<TransitionCollection>
|
|
||||||
<ContentThemeTransition/>
|
|
||||||
</TransitionCollection>
|
|
||||||
</cwcont:SwitchPresenter.ContentTransitions>
|
|
||||||
<cwcont:Case Value="List">
|
|
||||||
<ListView
|
|
||||||
ItemTemplate="{StaticResource OrangeListTemplate}"
|
|
||||||
ItemsSource="{Binding OrangeList}"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
|
||||||
SelectionMode="None">
|
|
||||||
<ListView.ItemContainerStyle>
|
|
||||||
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
|
||||||
<Setter Property="Padding" Value="0"/>
|
|
||||||
<Setter Property="Margin" Value="0,4,0,0"/>
|
|
||||||
</Style>
|
|
||||||
</ListView.ItemContainerStyle>
|
|
||||||
</ListView>
|
|
||||||
</cwcont:Case>
|
|
||||||
<cwcont:Case Value="Grid">
|
|
||||||
<GridView
|
|
||||||
Margin="0,0,-4,0"
|
|
||||||
ItemTemplate="{StaticResource OrangeGridTemplate}"
|
|
||||||
ItemsSource="{Binding OrangeList}"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
|
||||||
SelectionMode="None">
|
|
||||||
<GridView.ItemContainerStyle>
|
|
||||||
<Style BasedOn="{StaticResource DefaultGridViewItemStyle}" TargetType="GridViewItem">
|
|
||||||
<Setter Property="Padding" Value="0"/>
|
|
||||||
<Setter Property="Margin" Value="0,0,2,4"/>
|
|
||||||
</Style>
|
|
||||||
</GridView.ItemContainerStyle>
|
|
||||||
</GridView>
|
|
||||||
</cwcont:Case>
|
|
||||||
</cwcont:SwitchPresenter>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -16,159 +16,162 @@
|
|||||||
<ContentDialog.Resources>
|
<ContentDialog.Resources>
|
||||||
<x:Double x:Key="NumberBoxMinWidth">180</x:Double>
|
<x:Double x:Key="NumberBoxMinWidth">180</x:Double>
|
||||||
<x:Double x:Key="ContentDialogMaxWidth">1200</x:Double>
|
<x:Double x:Key="ContentDialogMaxWidth">1200</x:Double>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="SkillTemplate">
|
||||||
|
<Border Margin="0,2,0,0" Style="{StaticResource BorderCardStyle}">
|
||||||
|
<Grid Margin="8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<ColumnDefinition Width="160"/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<shci:MonoChrome
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="36"
|
||||||
|
Height="36"
|
||||||
|
Source="{Binding Icon}"/>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="16,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Name}"
|
||||||
|
TextTrimming="CharacterEllipsis"/>
|
||||||
|
<NumberBox
|
||||||
|
Grid.Column="2"
|
||||||
|
MinWidth="{StaticResource NumberBoxMinWidth}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Maximum="{Binding LevelMax}"
|
||||||
|
Minimum="{Binding LevelMin}"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Value="{Binding LevelCurrent, Mode=TwoWay}"/>
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="3"
|
||||||
|
Margin="8"
|
||||||
|
FontSize="12"
|
||||||
|
Glyph=""/>
|
||||||
|
<NumberBox
|
||||||
|
Grid.Column="4"
|
||||||
|
MinWidth="{StaticResource NumberBoxMinWidth}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Maximum="{Binding LevelMax}"
|
||||||
|
Minimum="{Binding LevelMin}"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Value="{Binding LevelTarget, Mode=TwoWay}"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
</ContentDialog.Resources>
|
</ContentDialog.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="auto"/>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="0,8,0,0"
|
Margin="0,8,0,0"
|
||||||
Visibility="{x:Bind Avatar, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
Visibility="{x:Bind Avatar, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Grid
|
||||||
<Grid Margin="8" DataContext="{x:Bind Avatar}">
|
Margin="8"
|
||||||
<Grid.ColumnDefinitions>
|
DataContext="{x:Bind Avatar}"
|
||||||
<ColumnDefinition Width="auto"/>
|
Style="{StaticResource BorderGridStyle}">
|
||||||
<ColumnDefinition Width="160"/>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="160"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="auto"/>
|
||||||
<shvc:ItemIcon
|
<ColumnDefinition/>
|
||||||
Grid.Column="0"
|
</Grid.ColumnDefinitions>
|
||||||
Width="36"
|
<shvc:ItemIcon
|
||||||
Height="36"
|
Grid.Column="0"
|
||||||
Icon="{Binding Icon}"
|
Width="36"
|
||||||
Quality="{Binding Quality}"/>
|
Height="36"
|
||||||
<TextBlock
|
Icon="{Binding Icon}"
|
||||||
Grid.Column="1"
|
Quality="{Binding Quality}"/>
|
||||||
Margin="16,0,0,0"
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
Grid.Column="1"
|
||||||
Text="{Binding Name}"
|
Margin="16,0,0,0"
|
||||||
TextTrimming="CharacterEllipsis"/>
|
VerticalAlignment="Center"
|
||||||
<NumberBox
|
Text="{Binding Name}"
|
||||||
Grid.Column="2"
|
TextTrimming="CharacterEllipsis"/>
|
||||||
MinWidth="{StaticResource NumberBoxMinWidth}"
|
<NumberBox
|
||||||
VerticalAlignment="Center"
|
Grid.Column="2"
|
||||||
Maximum="{Binding LevelMax}"
|
MinWidth="{StaticResource NumberBoxMinWidth}"
|
||||||
Minimum="{Binding LevelMin}"
|
VerticalAlignment="Center"
|
||||||
SpinButtonPlacementMode="Inline"
|
Maximum="{Binding LevelMax}"
|
||||||
Value="{Binding LevelCurrent, Mode=TwoWay}"/>
|
Minimum="{Binding LevelMin}"
|
||||||
<FontIcon
|
SpinButtonPlacementMode="Inline"
|
||||||
Grid.Column="3"
|
Value="{Binding LevelCurrent, Mode=TwoWay}"/>
|
||||||
Margin="8"
|
<FontIcon
|
||||||
FontSize="12"
|
Grid.Column="3"
|
||||||
Glyph=""/>
|
Margin="8"
|
||||||
<NumberBox
|
FontSize="12"
|
||||||
Grid.Column="4"
|
Glyph=""/>
|
||||||
MinWidth="{StaticResource NumberBoxMinWidth}"
|
<NumberBox
|
||||||
VerticalAlignment="Center"
|
Grid.Column="4"
|
||||||
Maximum="{Binding LevelMax}"
|
MinWidth="{StaticResource NumberBoxMinWidth}"
|
||||||
Minimum="{Binding LevelMin}"
|
VerticalAlignment="Center"
|
||||||
SpinButtonPlacementMode="Inline"
|
Maximum="{Binding LevelMax}"
|
||||||
Value="{Binding LevelTarget, Mode=TwoWay}"/>
|
Minimum="{Binding LevelMin}"
|
||||||
</Grid>
|
SpinButtonPlacementMode="Inline"
|
||||||
</Border>
|
Value="{Binding LevelTarget, Mode=TwoWay}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<ItemsControl ItemsSource="{x:Bind Avatar.Skills}">
|
<ItemsControl ItemTemplate="{StaticResource SkillTemplate}" ItemsSource="{x:Bind Avatar.Skills}"/>
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border Margin="0,2,0,0" Style="{StaticResource BorderCardStyle}">
|
|
||||||
<Grid Margin="8">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition Width="160"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<shci:MonoChrome
|
|
||||||
Grid.Column="0"
|
|
||||||
Width="36"
|
|
||||||
Height="36"
|
|
||||||
Source="{Binding Icon}"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="16,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Name}"
|
|
||||||
TextTrimming="CharacterEllipsis"/>
|
|
||||||
<NumberBox
|
|
||||||
Grid.Column="2"
|
|
||||||
MinWidth="{StaticResource NumberBoxMinWidth}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Maximum="{Binding LevelMax}"
|
|
||||||
Minimum="{Binding LevelMin}"
|
|
||||||
SpinButtonPlacementMode="Inline"
|
|
||||||
Value="{Binding LevelCurrent, Mode=TwoWay}"/>
|
|
||||||
<FontIcon
|
|
||||||
Grid.Column="3"
|
|
||||||
Margin="8"
|
|
||||||
FontSize="12"
|
|
||||||
Glyph=""/>
|
|
||||||
<NumberBox
|
|
||||||
Grid.Column="4"
|
|
||||||
MinWidth="{StaticResource NumberBoxMinWidth}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Maximum="{Binding LevelMax}"
|
|
||||||
Minimum="{Binding LevelMin}"
|
|
||||||
SpinButtonPlacementMode="Inline"
|
|
||||||
Value="{Binding LevelTarget, Mode=TwoWay}"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,8,0,0"
|
Margin="0,8,0,0"
|
||||||
Visibility="{x:Bind Weapon, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
Visibility="{x:Bind Weapon, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||||
<Border Style="{StaticResource BorderCardStyle}">
|
<Grid
|
||||||
<Grid Margin="8" DataContext="{x:Bind Weapon}">
|
Margin="8"
|
||||||
<Grid.ColumnDefinitions>
|
DataContext="{x:Bind Weapon}"
|
||||||
<ColumnDefinition Width="auto"/>
|
Style="{StaticResource BorderGridStyle}">
|
||||||
<ColumnDefinition Width="160"/>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="160"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="auto"/>
|
||||||
<shvc:ItemIcon
|
<ColumnDefinition/>
|
||||||
Grid.Column="0"
|
</Grid.ColumnDefinitions>
|
||||||
Width="36"
|
<shvc:ItemIcon
|
||||||
Height="36"
|
Grid.Column="0"
|
||||||
Icon="{Binding Icon}"
|
Width="36"
|
||||||
Quality="{Binding Quality}"/>
|
Height="36"
|
||||||
<TextBlock
|
Icon="{Binding Icon}"
|
||||||
Grid.Column="1"
|
Quality="{Binding Quality}"/>
|
||||||
Margin="16,0,0,0"
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
Grid.Column="1"
|
||||||
Text="{Binding Name}"
|
Margin="16,0,0,0"
|
||||||
TextTrimming="CharacterEllipsis"/>
|
VerticalAlignment="Center"
|
||||||
<NumberBox
|
Text="{Binding Name}"
|
||||||
Grid.Column="2"
|
TextTrimming="CharacterEllipsis"/>
|
||||||
MinWidth="{StaticResource NumberBoxMinWidth}"
|
<NumberBox
|
||||||
VerticalAlignment="Center"
|
Grid.Column="2"
|
||||||
Maximum="{Binding LevelMax}"
|
MinWidth="{StaticResource NumberBoxMinWidth}"
|
||||||
Minimum="{Binding LevelMin}"
|
VerticalAlignment="Center"
|
||||||
SpinButtonPlacementMode="Inline"
|
Maximum="{Binding LevelMax}"
|
||||||
Value="{Binding LevelCurrent, Mode=TwoWay}"/>
|
Minimum="{Binding LevelMin}"
|
||||||
<FontIcon
|
SpinButtonPlacementMode="Inline"
|
||||||
Grid.Column="3"
|
Value="{Binding LevelCurrent, Mode=TwoWay}"/>
|
||||||
Margin="8"
|
<FontIcon
|
||||||
FontSize="12"
|
Grid.Column="3"
|
||||||
Glyph=""/>
|
Margin="8"
|
||||||
<NumberBox
|
FontSize="12"
|
||||||
Grid.Column="4"
|
Glyph=""/>
|
||||||
MinWidth="{StaticResource NumberBoxMinWidth}"
|
<NumberBox
|
||||||
VerticalAlignment="Center"
|
Grid.Column="4"
|
||||||
Maximum="{Binding LevelMax}"
|
MinWidth="{StaticResource NumberBoxMinWidth}"
|
||||||
Minimum="{Binding LevelMin}"
|
VerticalAlignment="Center"
|
||||||
SpinButtonPlacementMode="Inline"
|
Maximum="{Binding LevelMax}"
|
||||||
Value="{Binding LevelTarget, Mode=TwoWay}"/>
|
Minimum="{Binding LevelMin}"
|
||||||
</Grid>
|
SpinButtonPlacementMode="Inline"
|
||||||
</Border>
|
Value="{Binding LevelTarget, Mode=TwoWay}"/>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ContentDialog>
|
</ContentDialog>
|
||||||
|
|||||||
@@ -27,15 +27,8 @@
|
|||||||
<cwc:HeaderedItemsControl
|
<cwc:HeaderedItemsControl
|
||||||
Padding="0,8,0,0"
|
Padding="0,8,0,0"
|
||||||
ItemTemplate="{StaticResource GachaItemDataTemplate}"
|
ItemTemplate="{StaticResource GachaItemDataTemplate}"
|
||||||
ItemsSource="{x:Bind Status.Items, Mode=OneWay}">
|
ItemsPanel="{StaticResource UniformGridColumns5Spacing4Template}"
|
||||||
<cwc:HeaderedItemsControl.ItemsPanel>
|
ItemsSource="{x:Bind Status.Items, Mode=OneWay}"/>
|
||||||
<ItemsPanelTemplate>
|
|
||||||
<cwc:UniformGrid
|
|
||||||
ColumnSpacing="4"
|
|
||||||
Columns="5"
|
|
||||||
RowSpacing="4"/>
|
|
||||||
</ItemsPanelTemplate>
|
|
||||||
</cwc:HeaderedItemsControl.ItemsPanel>
|
|
||||||
</cwc:HeaderedItemsControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</ContentDialog>
|
</ContentDialog>
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
using Microsoft.Web.WebView2.Core;
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace Snap.Hutao.View.Extension;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <see cref="CoreWebView2Environment"/> 扩展
|
|
||||||
/// </summary>
|
|
||||||
[HighQuality]
|
|
||||||
internal static class CoreWebView2EnvironmentExtension
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 退出
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="environment">环境</param>
|
|
||||||
public static void Exit(this CoreWebView2Environment environment)
|
|
||||||
{
|
|
||||||
// 暂不支持
|
|
||||||
IReadOnlyList<CoreWebView2ProcessInfo> processInfos = environment.GetProcessInfos();
|
|
||||||
|
|
||||||
foreach (CoreWebView2ProcessInfo processInfo in processInfos)
|
|
||||||
{
|
|
||||||
Process p = Process.GetProcessById(processInfo.ProcessId);
|
|
||||||
if (p.ProcessName == "msedgewebview2.exe")
|
|
||||||
{
|
|
||||||
p.Kill();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,6 +16,34 @@
|
|||||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||||
</mxi:Interaction.Behaviors>
|
</mxi:Interaction.Behaviors>
|
||||||
|
|
||||||
|
<UserControl.Resources>
|
||||||
|
<DataTemplate x:Key="LanguageTemplate">
|
||||||
|
<StackPanel MinWidth="240" Margin="16">
|
||||||
|
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{Binding Name}"/>
|
||||||
|
<TextBlock Opacity="0.8" Text="{Binding Value}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
|
||||||
|
<DataTemplate x:Key="DownloadSummaryTemplate" x:DataType="shvg:DownloadSummary">
|
||||||
|
<Border
|
||||||
|
Width="180"
|
||||||
|
Margin="0,0,4,4"
|
||||||
|
Style="{StaticResource BorderCardStyle}">
|
||||||
|
<StackPanel Margin="8">
|
||||||
|
<TextBlock Text="{Binding DisplayName}"/>
|
||||||
|
<ProgressBar
|
||||||
|
Margin="0,4,0,0"
|
||||||
|
Maximum="1"
|
||||||
|
Value="{Binding ProgressValue}"/>
|
||||||
|
<TextBlock
|
||||||
|
Opacity="0.6"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{Binding Description}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}">
|
<Grid Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
@@ -26,17 +54,10 @@
|
|||||||
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<GridView
|
<GridView
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
|
ItemTemplate="{StaticResource LanguageTemplate}"
|
||||||
ItemsSource="{Binding AppOptions.Cultures}"
|
ItemsSource="{Binding AppOptions.Cultures}"
|
||||||
SelectedItem="{Binding SelectedCulture, Mode=TwoWay}"
|
SelectedItem="{Binding SelectedCulture, Mode=TwoWay}"
|
||||||
SelectionMode="Single">
|
SelectionMode="Single"/>
|
||||||
<GridView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border MinWidth="240" Margin="16">
|
|
||||||
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{Binding Name}"/>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</GridView.ItemTemplate>
|
|
||||||
</GridView>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</cwc:Case>
|
</cwc:Case>
|
||||||
<cwc:Case Value="{shcm:UInt32 Value=1}">
|
<cwc:Case Value="{shcm:UInt32 Value=1}">
|
||||||
@@ -157,37 +178,10 @@
|
|||||||
<ItemsControl
|
<ItemsControl
|
||||||
Margin="0,0,-4,0"
|
Margin="0,0,-4,0"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
ItemContainerTransitions="{StaticResource ListViewLikeThemeTransitions}"
|
||||||
ItemsSource="{Binding DownloadSummaries}">
|
ItemTemplate="{StaticResource DownloadSummaryTemplate}"
|
||||||
<ItemsControl.ItemContainerTransitions>
|
ItemsPanel="{StaticResource WrapPanelSpacing0Template}"
|
||||||
<TransitionCollection>
|
ItemsSource="{Binding DownloadSummaries}"/>
|
||||||
<AddDeleteThemeTransition/>
|
|
||||||
<ContentThemeTransition/>
|
|
||||||
<ReorderThemeTransition/>
|
|
||||||
<EntranceThemeTransition IsStaggeringEnabled="False"/>
|
|
||||||
</TransitionCollection>
|
|
||||||
</ItemsControl.ItemContainerTransitions>
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border
|
|
||||||
Width="180"
|
|
||||||
Margin="0,0,4,4"
|
|
||||||
Style="{StaticResource BorderCardStyle}">
|
|
||||||
<StackPanel Margin="8">
|
|
||||||
<TextBlock Text="{Binding DisplayName}"/>
|
|
||||||
<ProgressBar
|
|
||||||
Margin="0,4,0,0"
|
|
||||||
Maximum="1"
|
|
||||||
Value="{Binding ProgressValue}"/>
|
|
||||||
<TextBlock
|
|
||||||
Opacity="0.6"
|
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
|
||||||
Text="{Binding Description}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</cwc:Case>
|
</cwc:Case>
|
||||||
|
|||||||
@@ -15,6 +15,5 @@ internal sealed partial class GuideView : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = Ioc.Default.GetRequiredService<GuideViewModel>();
|
DataContext = Ioc.Default.GetRequiredService<GuideViewModel>();
|
||||||
_ = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,13 @@ internal sealed class DownloadSummary : ObservableObject
|
|||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
{
|
{
|
||||||
string destPath = imageCacheFilePathOperation.GetFileFromCategoryAndName(fileName, entry.FullName);
|
string destPath = imageCacheFilePathOperation.GetFileFromCategoryAndName(fileName, entry.FullName);
|
||||||
entry.ExtractToFile(destPath, true);
|
try
|
||||||
|
{
|
||||||
|
entry.ExtractToFile(destPath, true);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,14 @@ internal sealed partial class GuideViewModel : Abstraction.ViewModel
|
|||||||
|
|
||||||
private async ValueTask DownloadStaticResourceAsync()
|
private async ValueTask DownloadStaticResourceAsync()
|
||||||
{
|
{
|
||||||
IEnumerable<DownloadSummary> downloadSummaries = GenerateStaticResourceDownloadTasks();
|
HashSet<DownloadSummary> downloadSummaries = new();
|
||||||
|
|
||||||
|
HashSet<string> categories = StaticResource.GetUnfulfilledCategorySet();
|
||||||
|
|
||||||
|
foreach (string category in categories)
|
||||||
|
{
|
||||||
|
downloadSummaries.Add(new(serviceProvider, category));
|
||||||
|
}
|
||||||
|
|
||||||
DownloadSummaries = downloadSummaries.ToObservableCollection();
|
DownloadSummaries = downloadSummaries.ToObservableCollection();
|
||||||
|
|
||||||
@@ -172,53 +179,9 @@ internal sealed partial class GuideViewModel : Abstraction.ViewModel
|
|||||||
}
|
}
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
|
|
||||||
StaticResource.FulfillAllContracts();
|
StaticResource.FulfillAll();
|
||||||
|
|
||||||
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.Completed);
|
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.Completed);
|
||||||
AppInstance.Restart(string.Empty);
|
AppInstance.Restart(string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<DownloadSummary> GenerateStaticResourceDownloadTasks()
|
|
||||||
{
|
|
||||||
Dictionary<string, DownloadSummary> downloadSummaries = new();
|
|
||||||
|
|
||||||
if (StaticResource.IsContractUnfulfilled(StaticResource.V1Contract))
|
|
||||||
{
|
|
||||||
downloadSummaries.TryAdd("Bg", new(serviceProvider, "Bg"));
|
|
||||||
downloadSummaries.TryAdd("AvatarIcon", new(serviceProvider, "AvatarIcon"));
|
|
||||||
downloadSummaries.TryAdd("GachaAvatarIcon", new(serviceProvider, "GachaAvatarIcon"));
|
|
||||||
downloadSummaries.TryAdd("GachaAvatarImg", new(serviceProvider, "GachaAvatarImg"));
|
|
||||||
downloadSummaries.TryAdd("EquipIcon", new(serviceProvider, "EquipIcon"));
|
|
||||||
downloadSummaries.TryAdd("GachaEquipIcon", new(serviceProvider, "GachaEquipIcon"));
|
|
||||||
downloadSummaries.TryAdd("NameCardPic", new(serviceProvider, "NameCardPic"));
|
|
||||||
downloadSummaries.TryAdd("Skill", new(serviceProvider, "Skill"));
|
|
||||||
downloadSummaries.TryAdd("Talent", new(serviceProvider, "Talent"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StaticResource.IsContractUnfulfilled(StaticResource.V2Contract))
|
|
||||||
{
|
|
||||||
downloadSummaries.TryAdd("AchievementIcon", new(serviceProvider, "AchievementIcon"));
|
|
||||||
downloadSummaries.TryAdd("ItemIcon", new(serviceProvider, "ItemIcon"));
|
|
||||||
downloadSummaries.TryAdd("IconElement", new(serviceProvider, "IconElement"));
|
|
||||||
downloadSummaries.TryAdd("RelicIcon", new(serviceProvider, "RelicIcon"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StaticResource.IsContractUnfulfilled(StaticResource.V3Contract))
|
|
||||||
{
|
|
||||||
downloadSummaries.TryAdd("Skill", new(serviceProvider, "Skill"));
|
|
||||||
downloadSummaries.TryAdd("Talent", new(serviceProvider, "Talent"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StaticResource.IsContractUnfulfilled(StaticResource.V4Contract))
|
|
||||||
{
|
|
||||||
downloadSummaries.TryAdd("AvatarIcon", new(serviceProvider, "AvatarIcon"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StaticResource.IsContractUnfulfilled(StaticResource.V5Contract))
|
|
||||||
{
|
|
||||||
downloadSummaries.TryAdd("MonsterIcon", new(serviceProvider, "MonsterIcon"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return downloadSummaries.Select(x => x.Value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
124
src/Snap.Hutao/Snap.Hutao/ViewModel/Guide/StaticResource.cs
Normal file
124
src/Snap.Hutao/Snap.Hutao/ViewModel/Guide/StaticResource.cs
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Snap.Hutao.Core.Setting;
|
||||||
|
using Windows.Storage;
|
||||||
|
|
||||||
|
namespace Snap.Hutao.ViewModel.Guide;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 静态资源
|
||||||
|
/// </summary>
|
||||||
|
[HighQuality]
|
||||||
|
internal static class StaticResource
|
||||||
|
{
|
||||||
|
private const string ContractMap = "StaticResourceContractMap";
|
||||||
|
|
||||||
|
private static readonly ApplicationDataCompositeValue DefaultResourceVersionMap = new()
|
||||||
|
{
|
||||||
|
{ "AchievementIcon", 0 },
|
||||||
|
{ "AvatarCard", 0 },
|
||||||
|
{ "AvatarIcon", 0 },
|
||||||
|
{ "Bg", 0 },
|
||||||
|
{ "ChapterIcon", 0 },
|
||||||
|
{ "CodexMonster", 0 },
|
||||||
|
{ "Costume", 0 },
|
||||||
|
{ "EmotionIcon", 0 },
|
||||||
|
{ "EquipIcon", 0 },
|
||||||
|
{ "GachaAvatarIcon", 0 },
|
||||||
|
{ "GachaAvatarImg", 0 },
|
||||||
|
{ "GachaEquipIcon", 0 },
|
||||||
|
{ "GcgCharAvatarIcon", 0 },
|
||||||
|
{ "IconElement", 0 },
|
||||||
|
{ "ItemIcon", 0 },
|
||||||
|
{ "LoadingPic", 0 },
|
||||||
|
{ "MonsterIcon", 0 },
|
||||||
|
{ "MonsterSmallIcon", 0 },
|
||||||
|
{ "NameCardIcon", 0 },
|
||||||
|
{ "NameCardPic", 0 },
|
||||||
|
{ "NameCardPicAlpha", 0 },
|
||||||
|
{ "Property", 0 },
|
||||||
|
{ "RelicIcon", 0 },
|
||||||
|
{ "Skill", 0 },
|
||||||
|
{ "Talent", 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
private static readonly ApplicationDataCompositeValue LatestResourceVersionMap = new()
|
||||||
|
{
|
||||||
|
{ "AchievementIcon", 1 },
|
||||||
|
{ "AvatarCard", 0 },
|
||||||
|
{ "AvatarIcon", 1 },
|
||||||
|
{ "Bg", 1 },
|
||||||
|
{ "ChapterIcon", 0 },
|
||||||
|
{ "CodexMonster", 0 },
|
||||||
|
{ "Costume", 0 },
|
||||||
|
{ "EmotionIcon", 0 },
|
||||||
|
{ "EquipIcon", 1 },
|
||||||
|
{ "GachaAvatarIcon", 1 },
|
||||||
|
{ "GachaAvatarImg", 1 },
|
||||||
|
{ "GachaEquipIcon", 1 },
|
||||||
|
{ "GcgCharAvatarIcon", 0 },
|
||||||
|
{ "IconElement", 1 },
|
||||||
|
{ "ItemIcon", 1 },
|
||||||
|
{ "LoadingPic", 0 },
|
||||||
|
{ "MonsterIcon", 1 },
|
||||||
|
{ "MonsterSmallIcon", 0 },
|
||||||
|
{ "NameCardIcon", 0 },
|
||||||
|
{ "NameCardPic", 1 },
|
||||||
|
{ "NameCardPicAlpha", 0 },
|
||||||
|
{ "Property", 1 },
|
||||||
|
{ "RelicIcon", 1 },
|
||||||
|
{ "Skill", 1 },
|
||||||
|
{ "Talent", 1 },
|
||||||
|
};
|
||||||
|
|
||||||
|
public static void FulfillAll()
|
||||||
|
{
|
||||||
|
LocalSetting.Set(ContractMap, LatestResourceVersionMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void FailAll()
|
||||||
|
{
|
||||||
|
LocalSetting.Set(ContractMap, DefaultResourceVersionMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Obsolete]
|
||||||
|
public static bool IsContractUnfulfilled(string contractKey)
|
||||||
|
{
|
||||||
|
return !LocalSetting.Get(contractKey, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsAnyUnfulfilledCategoryPresent()
|
||||||
|
{
|
||||||
|
ApplicationDataCompositeValue map = LocalSetting.Get(ContractMap, DefaultResourceVersionMap);
|
||||||
|
if (map.Count < LatestResourceVersionMap.Count)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ((string key, object value) in map)
|
||||||
|
{
|
||||||
|
if ((int)value < (int)LatestResourceVersionMap[key])
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HashSet<string> GetUnfulfilledCategorySet()
|
||||||
|
{
|
||||||
|
HashSet<string> result = new();
|
||||||
|
ApplicationDataCompositeValue map = LocalSetting.Get(ContractMap, DefaultResourceVersionMap);
|
||||||
|
foreach ((string key, object value) in LatestResourceVersionMap)
|
||||||
|
{
|
||||||
|
if ((int)value > (int)map[key])
|
||||||
|
{
|
||||||
|
result.Add(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -106,7 +106,7 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
|
|||||||
[Command("ResetStaticResourceCommand")]
|
[Command("ResetStaticResourceCommand")]
|
||||||
private static void ResetStaticResource()
|
private static void ResetStaticResource()
|
||||||
{
|
{
|
||||||
StaticResource.FailAllContracts();
|
StaticResource.FailAll();
|
||||||
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.StaticResourceBegin);
|
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.StaticResourceBegin);
|
||||||
AppInstance.Restart(string.Empty);
|
AppInstance.Restart(string.Empty);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user