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"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:cwc="using:CommunityToolkit.WinUI.Converters"
|
||||
xmlns:cwcw="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:cwcont="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:cwconv="using:CommunityToolkit.WinUI.Converters"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
||||
@@ -120,9 +120,9 @@
|
||||
<x:String x:Key="FontIconContentAsteriskBadge12"></x:String>
|
||||
<x:String x:Key="FontIconContentZipFolder"></x:String>
|
||||
<!-- Converters -->
|
||||
<cwc:BoolNegationConverter x:Key="BoolNegationConverter"/>
|
||||
<cwc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||
<cwc:FileSizeToFriendlyStringConverter x:Key="FileSizeToFriendlyStringConverter"/>
|
||||
<cwconv:BoolNegationConverter x:Key="BoolNegationConverter"/>
|
||||
<cwconv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||
<cwconv:FileSizeToFriendlyStringConverter x:Key="FileSizeToFriendlyStringConverter"/>
|
||||
<shmmc:AchievementIconConverter x:Key="AchievementIconConverter"/>
|
||||
<shmmc:AvatarCardConverter x:Key="AvatarCardConverter"/>
|
||||
<shmmc:AvatarIconConverter x:Key="AvatarIconConverter"/>
|
||||
@@ -178,11 +178,25 @@
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="{StaticResource CompatCornerRadius}"/>
|
||||
</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">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="LazyLoadingThreshold" Value="300"/>
|
||||
<Setter Property="LazyLoadingThreshold" Value="256"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="shci:CachedImage">
|
||||
@@ -259,16 +273,34 @@
|
||||
<ItemsPanelTemplate x:Key="ItemsStackPanelTemplate">
|
||||
<ItemsStackPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
<ItemsPanelTemplate x:Key="WrapPanelTemplate">
|
||||
<cwcw:WrapPanel/>
|
||||
<ItemsPanelTemplate x:Key="WrapPanelSpacing0Template">
|
||||
<cwcont:WrapPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
<ItemsPanelTemplate x:Key="WrapPanelSpacing4Template">
|
||||
<cwcont:WrapPanel HorizontalSpacing="4" VerticalSpacing="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
<ItemsPanelTemplate x:Key="HorizontalStackPanelTemplate">
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
<ItemsPanelTemplate x:Key="UniformGridColumns5Spacing4Template">
|
||||
<cwcont:UniformGrid
|
||||
ColumnSpacing="4"
|
||||
Columns="5"
|
||||
RowSpacing="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
<!-- Transitions -->
|
||||
<TransitionCollection x:Key="ReorderThemeTransitions">
|
||||
<ReorderThemeTransition/>
|
||||
</TransitionCollection>
|
||||
<TransitionCollection x:Key="ContentThemeTransitions">
|
||||
<ContentThemeTransition/>
|
||||
</TransitionCollection>
|
||||
<TransitionCollection x:Key="ListViewLikeThemeTransitions">
|
||||
<AddDeleteThemeTransition/>
|
||||
<ContentThemeTransition/>
|
||||
<ReorderThemeTransition/>
|
||||
<EntranceThemeTransition IsStaggeringEnabled="False"/>
|
||||
</TransitionCollection>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -12,7 +12,6 @@ internal sealed class Int32Extension : MarkupExtension
|
||||
|
||||
protected override object ProvideValue()
|
||||
{
|
||||
_ = int.TryParse(Value, out int result);
|
||||
return result;
|
||||
return XamlBindingHelper.ConvertValue(typeof(int), Value);
|
||||
}
|
||||
}
|
||||
@@ -141,6 +141,11 @@ internal sealed partial class Activation : IActivation
|
||||
// Increase launch times
|
||||
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)
|
||||
{
|
||||
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)]
|
||||
internal sealed partial class GuideWindow : Window, IWindowOptionsSource
|
||||
{
|
||||
private const int MinWidth = 800;
|
||||
private const int MinHeight = 450;
|
||||
private const int MinWidth = 1000;
|
||||
private const int MinHeight = 600;
|
||||
|
||||
private const int MaxWidth = 1200;
|
||||
private const int MaxHeight = 750;
|
||||
|
||||
@@ -114,7 +114,6 @@
|
||||
<None Remove="View\Card\Primitive\CardProgressBar.xaml" />
|
||||
<None Remove="View\Control\BaseValueSlider.xaml" />
|
||||
<None Remove="View\Control\BottomTextControl.xaml" />
|
||||
<None Remove="View\Control\BottomTextSmallControl.xaml" />
|
||||
<None Remove="View\Control\DescParamComboBox.xaml" />
|
||||
<None Remove="View\Control\Elevation.xaml" />
|
||||
<None Remove="View\Control\HutaoStatisticsCard.xaml" />
|
||||
@@ -348,12 +347,6 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="View\Control\BottomTextSmallControl.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="GuideWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -11,7 +11,14 @@
|
||||
<UserControl.Resources>
|
||||
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
|
||||
<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>
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel VerticalAlignment="Top">
|
||||
<cwc:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
|
||||
@@ -41,14 +48,9 @@
|
||||
</cwc:SettingsCard>
|
||||
</StackPanel>
|
||||
|
||||
<ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind BaseValueInfo.Values, Mode=OneWay}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<cwc:SettingsCard Margin="0,2,0,0" Header="{Binding Name}">
|
||||
<TextBlock Text="{Binding Value}"/>
|
||||
</cwc:SettingsCard>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ItemsControl
|
||||
VerticalAlignment="Top"
|
||||
ItemTemplate="{StaticResource BaseValueTemplate}"
|
||||
ItemsSource="{x:Bind BaseValueInfo.Values, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<ContentControl
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.Control.BottomTextControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:cw="using:CommunityToolkit.WinUI"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border Style="{StaticResource BorderCardStyle}">
|
||||
@@ -15,13 +16,15 @@
|
||||
Content="{x:Bind TopContent, Mode=OneWay}"/>
|
||||
<TextBlock
|
||||
MaxWidth="{x:Bind ContentHost.(cw:FrameworkElementExtensions.ActualWidth), Mode=OneWay}"
|
||||
Margin="0,0,0,2"
|
||||
Margin="0,1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Foreground="{x:Bind Foreground}"
|
||||
HorizontalTextAlignment="Center"
|
||||
Style="{x:Bind TextStyle, Mode=OneWay}"
|
||||
Text="{x:Bind Text, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</ContentControl>
|
||||
</UserControl>
|
||||
|
||||
@@ -14,15 +14,17 @@ namespace Snap.Hutao.View.Control;
|
||||
[HighQuality]
|
||||
[ContentProperty(Name = nameof(TopContent))]
|
||||
[DependencyProperty("Text", typeof(string), "")]
|
||||
[DependencyProperty("TextStyle", typeof(Style))]
|
||||
[DependencyProperty("Fill", typeof(Brush), default!)]
|
||||
[DependencyProperty("TopContent", typeof(FrameworkElement), default!)]
|
||||
internal sealed partial class BottomTextControl : ContentControl
|
||||
internal sealed partial class BottomTextControl : UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的底部带有文本的控件
|
||||
/// </summary>
|
||||
public BottomTextControl()
|
||||
{
|
||||
TextStyle = Ioc.Default.GetRequiredService<IAppResourceProvider>().GetResource<Style>("BodyTextBlockStyle");
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:shmm="using:Snap.Hutao.Model.Metadata"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
|
||||
<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>
|
||||
|
||||
<StackPanel>
|
||||
<StackPanel Margin="0,0,0,0" VerticalAlignment="Top">
|
||||
<cwc:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
|
||||
<ComboBox
|
||||
DisplayMemberPath="Level"
|
||||
ItemsSource="{x:Bind Source, Mode=OneWay}"
|
||||
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
|
||||
Style="{StaticResource SettingsContentComboBoxStyle}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Level}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
Style="{StaticResource SettingsContentComboBoxStyle}"/>
|
||||
</cwc:SettingsCard>
|
||||
</StackPanel>
|
||||
|
||||
<ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind SelectedItem.Parameters, Mode=OneWay}">
|
||||
<ItemsControl.ItemContainerTransitions>
|
||||
<TransitionCollection>
|
||||
<ContentThemeTransition/>
|
||||
</TransitionCollection>
|
||||
</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>
|
||||
<ItemsControl
|
||||
VerticalAlignment="Top"
|
||||
ItemContainerTransitions="{StaticResource ContentThemeTransitions}"
|
||||
ItemTemplate="{StaticResource ParameterDescriptionTemplate}"
|
||||
ItemsSource="{x:Bind SelectedItem.Parameters, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -15,80 +15,67 @@
|
||||
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="GridTemplate" d:DataType="shvg:StatisticsItem">
|
||||
<Border
|
||||
Width="40"
|
||||
Margin="0,4,4,0"
|
||||
Style="{StaticResource BorderCardStyle}">
|
||||
<StackPanel>
|
||||
<shvcont:ItemIcon
|
||||
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>
|
||||
<shvcont:BottomTextControl Text="{Binding Count}" TextStyle="{StaticResource CaptionTextBlockStyle}">
|
||||
<shvcont:ItemIcon
|
||||
shch:FrameworkElementHelper.SquareLength="40"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</shvcont:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border Style="{StaticResource BorderCardStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Style="{StaticResource BorderGridStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
CornerRadius="{StaticResource CompatCornerRadiusTop}"
|
||||
Style="{StaticResource BorderGridStyle}">
|
||||
<shcp:AspectRatio TargetHeight="320" TargetWidth="690"/>
|
||||
<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.Row="0"
|
||||
CornerRadius="{StaticResource CompatCornerRadiusTop}"
|
||||
Style="{StaticResource BorderGridStyle}">
|
||||
<shcp:AspectRatio TargetHeight="320" TargetWidth="690"/>
|
||||
<shci:CachedImage Source="{Binding Event.Banner}"/>
|
||||
</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>
|
||||
|
||||
@@ -19,11 +19,10 @@
|
||||
<shci:CachedImage EnableLazyLoading="False" Source="{StaticResource UI_ImgSign_ItemIcon}"/>
|
||||
<shci:CachedImage Source="{x:Bind Icon, Mode=OneWay}"/>
|
||||
<shci:CachedImage
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="2"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
shch:FrameworkElementHelper.SquareLength="16"
|
||||
EnableLazyLoading="False"
|
||||
Source="{x:Bind Badge, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
@@ -11,6 +11,50 @@
|
||||
IsExpanded="True"
|
||||
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.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
@@ -52,50 +96,9 @@
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
NavigateUri="{Binding Path}"/>
|
||||
<MenuFlyoutSeparator Grid.Row="2" Margin="4,16,4,0"/>
|
||||
<ItemsControl Grid.Row="3" ItemsSource="{Binding VoicePacks}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<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>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ItemsControl
|
||||
Grid.Row="3"
|
||||
ItemTemplate="{StaticResource VoicePackageTemplate}"
|
||||
ItemsSource="{Binding VoicePacks}"/>
|
||||
</Grid>
|
||||
</Expander>
|
||||
|
||||
@@ -15,25 +15,24 @@
|
||||
<Style BasedOn="{StaticResource DefaultPivotHeaderItemStyle}" TargetType="PivotHeaderItem">
|
||||
<Setter Property="Height" Value="80"/>
|
||||
</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>
|
||||
|
||||
<Pivot
|
||||
x:Name="ItemHost"
|
||||
HeaderTemplate="{StaticResource SkillHeaderTemplate}"
|
||||
ItemTemplate="{x:Bind ItemTemplate}"
|
||||
ItemsSource="{x:Bind Skills, Mode=OneWay}"
|
||||
SelectedItem="{x:Bind Selected}"
|
||||
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>
|
||||
Style="{StaticResource DefaultPivotStyle}"/>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
xmlns:shcp="using:Snap.Hutao.Control.Panel"
|
||||
xmlns:shvcont="using:Snap.Hutao.View.Control"
|
||||
xmlns:shvconv="using:Snap.Hutao.View.Converter"
|
||||
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
|
||||
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
|
||||
d:DataContext="{d:DesignInstance shvg:TypedWishSummary}"
|
||||
mc:Ignorable="d">
|
||||
@@ -84,287 +85,235 @@
|
||||
TrueValue="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
|
||||
|
||||
<DataTemplate x:Key="OrangeGridTemplate" d:DataType="shvg:SummaryItem">
|
||||
<shvcont:BottomTextSmallControl
|
||||
<shvcont:BottomTextControl
|
||||
Background="{Binding IsUp, Converter={StaticResource BoolToBrushConverter}}"
|
||||
Text="{Binding LastPull}"
|
||||
TextStyle="{StaticResource CaptionTextBlockStyle}"
|
||||
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
||||
<shvcont:BottomTextSmallControl.Foreground>
|
||||
<shvcont:BottomTextControl.Foreground>
|
||||
<SolidColorBrush Color="{Binding Color}"/>
|
||||
</shvcont:BottomTextSmallControl.Foreground>
|
||||
</shvcont:BottomTextControl.Foreground>
|
||||
<shvcont:ItemIcon
|
||||
shch:FrameworkElementHelper.SquareLength="40"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</shvcont:BottomTextSmallControl>
|
||||
</shvcont:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border Style="{StaticResource BorderCardStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Expander
|
||||
x:Name="DetailExpander"
|
||||
Padding="16,0,16,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderBrush="{x:Null}"
|
||||
BorderThickness="0"
|
||||
CornerRadius="4,4,0,0"
|
||||
IsExpanded="True">
|
||||
<Expander.Resources>
|
||||
<Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,1</Thickness>
|
||||
</Expander.Resources>
|
||||
<Expander.Header>
|
||||
<Grid>
|
||||
<Grid Style="{StaticResource BorderGridStyle}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Expander
|
||||
x:Name="DetailExpander"
|
||||
Padding="16,0,16,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderBrush="{x:Null}"
|
||||
BorderThickness="0"
|
||||
CornerRadius="4,4,0,0"
|
||||
IsExpanded="True">
|
||||
<Expander.Resources>
|
||||
<Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,1</Thickness>
|
||||
</Expander.Resources>
|
||||
<Expander.Header>
|
||||
<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>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
<shvcp:CardProgressBar
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Name}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"/>
|
||||
<StackPanel
|
||||
MinHeight="32"
|
||||
Description="{Binding LastOrangePull}"
|
||||
Header="{shcm:ResourceString Name=ViewControlStatisticsCardToLastOrangeText}"
|
||||
Maximum="{Binding GuaranteeOrangeThreshold}"
|
||||
ProgressForeground="{StaticResource OrangeBrush}"
|
||||
TextForeground="{StaticResource OrangeBrush}"
|
||||
Value="{Binding LastOrangePull}"/>
|
||||
<shvcp:CardProgressBar
|
||||
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>
|
||||
MinHeight="32"
|
||||
Description="{Binding LastPurplePull}"
|
||||
Header="{shcm:ResourceString Name=ViewControlStatisticsCardToLastPurpleText}"
|
||||
Maximum="{Binding GuaranteePurpleThreshold}"
|
||||
ProgressForeground="{StaticResource PurpleBrush}"
|
||||
TextForeground="{StaticResource PurpleBrush}"
|
||||
Value="{Binding LastPurplePull}"/>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
@@ -16,159 +16,162 @@
|
||||
<ContentDialog.Resources>
|
||||
<x:Double x:Key="NumberBoxMinWidth">180</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>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Margin="0,8,0,0"
|
||||
Visibility="{x:Bind Avatar, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||
<Border Style="{StaticResource BorderCardStyle}">
|
||||
<Grid Margin="8" DataContext="{x:Bind Avatar}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="160"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shvc:ItemIcon
|
||||
Grid.Column="0"
|
||||
Width="36"
|
||||
Height="36"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
<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>
|
||||
<Grid
|
||||
Margin="8"
|
||||
DataContext="{x:Bind Avatar}"
|
||||
Style="{StaticResource BorderGridStyle}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="160"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shvc:ItemIcon
|
||||
Grid.Column="0"
|
||||
Width="36"
|
||||
Height="36"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
<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>
|
||||
|
||||
<ItemsControl 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>
|
||||
<ItemsControl ItemTemplate="{StaticResource SkillTemplate}" ItemsSource="{x:Bind Avatar.Skills}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
Visibility="{x:Bind Weapon, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||
<Border Style="{StaticResource BorderCardStyle}">
|
||||
<Grid Margin="8" DataContext="{x:Bind Weapon}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="160"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shvc:ItemIcon
|
||||
Grid.Column="0"
|
||||
Width="36"
|
||||
Height="36"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
<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>
|
||||
<Grid
|
||||
Margin="8"
|
||||
DataContext="{x:Bind Weapon}"
|
||||
Style="{StaticResource BorderGridStyle}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="160"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shvc:ItemIcon
|
||||
Grid.Column="0"
|
||||
Width="36"
|
||||
Height="36"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
<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>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -27,15 +27,8 @@
|
||||
<cwc:HeaderedItemsControl
|
||||
Padding="0,8,0,0"
|
||||
ItemTemplate="{StaticResource GachaItemDataTemplate}"
|
||||
ItemsSource="{x:Bind Status.Items, Mode=OneWay}">
|
||||
<cwc:HeaderedItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<cwc:UniformGrid
|
||||
ColumnSpacing="4"
|
||||
Columns="5"
|
||||
RowSpacing="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</cwc:HeaderedItemsControl.ItemsPanel>
|
||||
</cwc:HeaderedItemsControl>
|
||||
ItemsPanel="{StaticResource UniformGridColumns5Spacing4Template}"
|
||||
ItemsSource="{x:Bind Status.Items, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
|
||||
</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}"/>
|
||||
</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.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
@@ -26,17 +54,10 @@
|
||||
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<GridView
|
||||
Grid.Row="0"
|
||||
ItemTemplate="{StaticResource LanguageTemplate}"
|
||||
ItemsSource="{Binding AppOptions.Cultures}"
|
||||
SelectedItem="{Binding SelectedCulture, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border MinWidth="240" Margin="16">
|
||||
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{Binding Name}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
SelectionMode="Single"/>
|
||||
</Grid>
|
||||
</cwc:Case>
|
||||
<cwc:Case Value="{shcm:UInt32 Value=1}">
|
||||
@@ -157,37 +178,10 @@
|
||||
<ItemsControl
|
||||
Margin="0,0,-4,0"
|
||||
HorizontalAlignment="Center"
|
||||
ItemsPanel="{StaticResource WrapPanelTemplate}"
|
||||
ItemsSource="{Binding DownloadSummaries}">
|
||||
<ItemsControl.ItemContainerTransitions>
|
||||
<TransitionCollection>
|
||||
<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>
|
||||
ItemContainerTransitions="{StaticResource ListViewLikeThemeTransitions}"
|
||||
ItemTemplate="{StaticResource DownloadSummaryTemplate}"
|
||||
ItemsPanel="{StaticResource WrapPanelSpacing0Template}"
|
||||
ItemsSource="{Binding DownloadSummaries}"/>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</cwc:Case>
|
||||
|
||||
@@ -15,6 +15,5 @@ internal sealed partial class GuideView : UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = Ioc.Default.GetRequiredService<GuideViewModel>();
|
||||
_ = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,13 @@ internal sealed class DownloadSummary : ObservableObject
|
||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||
{
|
||||
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()
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -172,53 +179,9 @@ internal sealed partial class GuideViewModel : Abstraction.ViewModel
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
StaticResource.FulfillAllContracts();
|
||||
StaticResource.FulfillAll();
|
||||
|
||||
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.Completed);
|
||||
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")]
|
||||
private static void ResetStaticResource()
|
||||
{
|
||||
StaticResource.FailAllContracts();
|
||||
StaticResource.FailAll();
|
||||
LocalSetting.Set(SettingKeys.Major1Minor7Revision0GuideState, (uint)GuideState.StaticResourceBegin);
|
||||
AppInstance.Restart(string.Empty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user