migrate to CommunityToolkit.Labs.WinUI.SettingsControls

This commit is contained in:
DismissedLight
2023-03-16 18:22:30 +08:00
parent 1d88360528
commit ece3f2cd08
22 changed files with 768 additions and 913 deletions

View File

@@ -10,7 +10,6 @@
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<muxc:XamlControlsResources/> <muxc:XamlControlsResources/>
<ResourceDictionary Source="ms-appx:///SettingsUI/Themes/Generic.xaml"/>
<ResourceDictionary Source="Control/Theme/FontStyle.xaml"/> <ResourceDictionary Source="Control/Theme/FontStyle.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
@@ -48,6 +47,17 @@
<GridLength x:Key="CompatGridLength2">268</GridLength> <GridLength x:Key="CompatGridLength2">268</GridLength>
<!-- Brushes --> <!-- Brushes -->
<SolidColorBrush x:Key="AvatarPropertyAddValueBrush" Color="{ThemeResource AvatarPropertyAddValueColor}"/> <SolidColorBrush x:Key="AvatarPropertyAddValueBrush" Color="{ThemeResource AvatarPropertyAddValueColor}"/>
<!-- Settings -->
<x:Double x:Key="SettingsCardSpacing">3</x:Double>
<Style
x:Key="SettingsSectionHeaderTextBlockStyle"
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
TargetType="TextBlock">
<Style.Setters>
<Setter Property="Margin" Value="1,29,0,5"/>
</Style.Setters>
</Style>
<!-- Uris --> <!-- Uris -->
<x:String x:Key="DocumentLink_MhyAccountSwitch">https://hut.ao/features/mhy-account-switch.html</x:String> <x:String x:Key="DocumentLink_MhyAccountSwitch">https://hut.ao/features/mhy-account-switch.html</x:String>
<x:String x:Key="DocumentLink_BugReport">https://hut.ao/statements/bug-report.html</x:String> <x:String x:Key="DocumentLink_BugReport">https://hut.ao/statements/bug-report.html</x:String>

View File

@@ -1,10 +1,7 @@
<!-- Copyright (c) Microsoft Corporation and Contributors. --> <!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Licensed under the MIT License. --> <!-- Licensed under the MIT License. -->
<ResourceDictionary <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls">
<FontFamily x:Key="MiSans">ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans</FontFamily> <FontFamily x:Key="MiSans">ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans</FontFamily>
<FontFamily x:Key="CascadiaMonoAndMiSans">ms-appx:///Resource/Font/CascadiaMono.ttf#Cascadia Mono, ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans</FontFamily> <FontFamily x:Key="CascadiaMonoAndMiSans">ms-appx:///Resource/Font/CascadiaMono.ttf#Cascadia Mono, ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans</FontFamily>
@@ -84,6 +81,13 @@
<Setter Property="OpticalMarginAlignment" Value="TrimSideBearings"/> <Setter Property="OpticalMarginAlignment" Value="TrimSideBearings"/>
</Style> </Style>
<x:Double x:Key="SecondaryTextFontSize">12</x:Double>
<Style x:Key="SecondaryTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="{StaticResource SecondaryTextFontSize}"/>
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}"/>
</Style>
<Style BasedOn="{StaticResource DefaultMenuFlyoutItemStyle}" TargetType="MenuFlyoutItem"> <Style BasedOn="{StaticResource DefaultMenuFlyoutItemStyle}" TargetType="MenuFlyoutItem">
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/> <Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
</Style> </Style>
@@ -99,112 +103,4 @@
<Style TargetType="InfoBar"> <Style TargetType="InfoBar">
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/> <Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
</Style> </Style>
<Style BasedOn="{StaticResource DefaultSettingStyle}" TargetType="wsc:Setting"/>
<Style x:Key="DefaultSettingStyle" TargetType="wsc:Setting">
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
<Setter Property="Background" Value="{ThemeResource CardBackgroundBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource CardBorderThickness}"/>
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="16"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="wsc:Setting">
<Grid
x:Name="RootGrid"
MinHeight="48"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- Icon -->
<ColumnDefinition Width="*"/>
<!-- Header and subtitle -->
<ColumnDefinition Width="Auto"/>
<!-- Action control -->
</Grid.ColumnDefinitions>
<ContentPresenter
x:Name="IconPresenter"
MaxWidth="20"
Margin="2,0,18,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"
Content="{TemplateBinding Icon}"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="20"
Foreground="{ThemeResource CardPrimaryForegroundBrush}"
IsTextScaleFactorEnabled="False"/>
<StackPanel
Grid.Column="1"
Margin="0,0,16,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center">
<TextBlock
x:Name="HeaderPresenter"
VerticalAlignment="Center"
FontFamily="{StaticResource MiSans}"
Foreground="{ThemeResource CardPrimaryForegroundBrush}"
Text="{TemplateBinding Header}"/>
<ContentPresenter
x:Name="DescriptionPresenter"
Content="{TemplateBinding Description}"
FontFamily="{StaticResource MiSans}"
FontSize="{StaticResource SecondaryTextFontSize}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="WrapWholeWords">
<ContentPresenter.Resources>
<Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock">
<Style.Setters>
<Setter Property="TextWrapping" Value="WrapWholeWords"/>
</Style.Setters>
</Style>
<Style BasedOn="{StaticResource TextButtonStyle}" TargetType="HyperlinkButton">
<Style.Setters>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Padding" Value="0,0,0,0"/>
</Style.Setters>
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
</StackPanel>
<ContentPresenter
x:Name="ContentPresenter"
Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="{TemplateBinding ActionContent}"/>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="HeaderPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}"/>
<Setter Target="DescriptionPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}"/>
<Setter Target="IconPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}"/>
<Setter Target="ContentPresenter.Foreground" Value="{ThemeResource TextFillColorDisabledBrush}"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -2,7 +2,7 @@
"profiles": { "profiles": {
"Snap.Hutao (Package)": { "Snap.Hutao (Package)": {
"commandName": "MsixPackage", "commandName": "MsixPackage",
"nativeDebugging": false, "nativeDebugging": true,
"doNotLaunchApp": false, "doNotLaunchApp": false,
"allowLocalNetworkLoopbackProperty": true "allowLocalNetworkLoopbackProperty": true
}, },

View File

@@ -1986,6 +1986,15 @@ namespace Snap.Hutao.Resource.Localization {
} }
} }
/// <summary>
/// 查找类似 设置 Cookie 的本地化字符串。
/// </summary>
internal static string ViewDialogUserTitle {
get {
return ResourceManager.GetString("ViewDialogUserTitle", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 祈愿记录 的本地化字符串。 /// 查找类似 祈愿记录 的本地化字符串。
/// </summary> /// </summary>
@@ -3850,7 +3859,7 @@ namespace Snap.Hutao.Resource.Localization {
} }
/// <summary> /// <summary>
/// 查找类似 账号 的本地化字符串。 /// 查找类似 检测账号 的本地化字符串。
/// </summary> /// </summary>
internal static string ViewPageLaunchGameSwitchAccountHeader { internal static string ViewPageLaunchGameSwitchAccountHeader {
get { get {
@@ -4201,25 +4210,7 @@ namespace Snap.Hutao.Resource.Localization {
} }
/// <summary> /// <summary>
/// 查找类似 在完整阅读原神和胡桃工具箱用户协议后,我选择启用「启动游戏-高级功能」 的本地化字符串。 /// 查找类似 您解锁了含有违反原神服务条款风险的「启动游戏-高级功能」,将自行承担任何不良后果。 的本地化字符串。
/// </summary>
internal static string ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription {
get {
return ResourceManager.GetString("ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription", resourceCulture);
}
}
/// <summary>
/// 查找类似 启动高级功能 的本地化字符串。
/// </summary>
internal static string ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader {
get {
return ResourceManager.GetString("ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader", resourceCulture);
}
}
/// <summary>
/// 查找类似 您解锁了「启动游戏-高级功能」!其含有潜在违反原神服务条款的风险,一旦启用,您将咨询承担可能的后果。慎重选择! 的本地化字符串。
/// </summary> /// </summary>
internal static string ViewPageSettingFeaturesDangerousHint { internal static string ViewPageSettingFeaturesDangerousHint {
get { get {
@@ -4272,6 +4263,24 @@ namespace Snap.Hutao.Resource.Localization {
} }
} }
/// <summary>
/// 查找类似 在完整阅读原神和胡桃工具箱用户协议后,我选择启用「启动游戏-高级功能」 的本地化字符串。
/// </summary>
internal static string ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription {
get {
return ResourceManager.GetString("ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription", resourceCulture);
}
}
/// <summary>
/// 查找类似 启动高级功能 的本地化字符串。
/// </summary>
internal static string ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader {
get {
return ResourceManager.GetString("ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 相关链接 的本地化字符串。 /// 查找类似 相关链接 的本地化字符串。
/// </summary> /// </summary>

View File

@@ -1381,7 +1381,7 @@
<value>检测</value> <value>检测</value>
</data> </data>
<data name="ViewPageLaunchGameSwitchAccountHeader" xml:space="preserve"> <data name="ViewPageLaunchGameSwitchAccountHeader" xml:space="preserve">
<value>账号</value> <value>检测账号</value>
</data> </data>
<data name="ViewPageLaunchGameSwitchAccountRemoveToolTip" xml:space="preserve"> <data name="ViewPageLaunchGameSwitchAccountRemoveToolTip" xml:space="preserve">
<value>删除</value> <value>删除</value>
@@ -1504,7 +1504,7 @@
<value>启动高级功能</value> <value>启动高级功能</value>
</data> </data>
<data name="ViewPageSettingFeaturesDangerousHint" xml:space="preserve"> <data name="ViewPageSettingFeaturesDangerousHint" xml:space="preserve">
<value>您解锁了「启动游戏-高级功能」!其含有潜在违反原神服务条款风险,一旦启用,您将咨询承担可能的后果。慎重选择!</value> <value>您解锁了含有违反原神服务条款风险的「启动游戏-高级功能」,将自行承担任何不良后果。</value>
</data> </data>
<data name="ViewPageSettingFeedbackDescription" xml:space="preserve"> <data name="ViewPageSettingFeedbackDescription" xml:space="preserve">
<value>Github 上反馈的问题会优先处理</value> <value>Github 上反馈的问题会优先处理</value>
@@ -1785,4 +1785,7 @@
<data name="WebResponseFormat" xml:space="preserve"> <data name="WebResponseFormat" xml:space="preserve">
<value>状态:{0} | 信息:{1}</value> <value>状态:{0} | 信息:{1}</value>
</data> </data>
<data name="ViewDialogUserTitle" xml:space="preserve">
<value>设置 Cookie</value>
</data>
</root> </root>

View File

@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.18362.0</TargetFramework> <TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion> <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Snap.Hutao</RootNamespace> <RootNamespace>Snap.Hutao</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<Platform>x64</Platform> <Platform>x64</Platform>
@@ -227,12 +227,13 @@
<!-- Packages --> <!-- Packages -->
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Labs.WinUI.SettingsControls" Version="0.0.17" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" /> <PackageReference Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Behaviors" Version="7.1.2" /> <PackageReference Include="CommunityToolkit.WinUI.UI.Behaviors" Version="7.1.2" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" /> <PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.3" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.3"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.4">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
@@ -249,13 +250,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" /> <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.230217.4" /> <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.230313.1" />
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435"> <PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="TaskScheduler" Version="2.10.1" /> <PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="WinUICommunity.SettingsUI" Version="3.0.4" />
<Manifest Include="$(ApplicationManifest)" /> <Manifest Include="$(ApplicationManifest)" />
</ItemGroup> </ItemGroup>

View File

@@ -2,54 +2,51 @@
x:Class="Snap.Hutao.View.Control.BaseValueSlider" x:Class="Snap.Hutao.View.Control.BaseValueSlider"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources>
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
</UserControl.Resources>
<StackPanel> <StackPanel>
<wsc:SettingsGroup Margin="0,-64,0,0" VerticalAlignment="Top"> <StackPanel VerticalAlignment="Top">
<wsc:Setting Padding="12,0,6,0" Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}"> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
<wsc:Setting.ActionContent> <StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal"> <TextBlock
<TextBlock Margin="8,0"
Margin="8,0" VerticalAlignment="Center"
VerticalAlignment="Center" Text="{x:Bind BaseValueInfo.CurrentLevelFormatted, Mode=OneWay}"/>
Text="{x:Bind BaseValueInfo.CurrentLevelFormatted, Mode=OneWay}"/> <CheckBox
<CheckBox MinWidth="0"
MinWidth="0" Margin="16,0,8,0"
Margin="16,0,8,0" Padding="8,0,0,0"
Padding="8,0,0,0" VerticalAlignment="Center"
VerticalAlignment="Center" VerticalContentAlignment="Center"
VerticalContentAlignment="Center" Content="{shcm:ResourceString Name=ViewControlBaseValueSliderPromoted}"
Content="{shcm:ResourceString Name=ViewControlBaseValueSliderPromoted}" IsChecked="{x:Bind BaseValueInfo.Promoted, Mode=TwoWay}"
IsChecked="{x:Bind BaseValueInfo.Promoted, Mode=TwoWay}" Visibility="{x:Bind IsPromoteVisible, Converter={StaticResource BoolToVisibilityConverter}}"/>
Visibility="{x:Bind IsPromoteVisible, Converter={StaticResource BoolToVisibilityConverter}}"/> <Slider
<Slider MinWidth="240"
MinWidth="240" Margin="16,0,8,0"
Margin="16,0,8,0" VerticalAlignment="Center"
VerticalAlignment="Center" Maximum="{x:Bind BaseValueInfo.MaxLevel, Mode=OneWay}"
Maximum="{x:Bind BaseValueInfo.MaxLevel, Mode=OneWay}" Minimum="1"
Minimum="1" StepFrequency="1"
StepFrequency="1" Value="{x:Bind BaseValueInfo.CurrentLevel, Mode=TwoWay}"/>
Value="{x:Bind BaseValueInfo.CurrentLevel, Mode=TwoWay}"/> </StackPanel>
</StackPanel> </clw:SettingsCard>
</wsc:Setting.ActionContent> </StackPanel>
</wsc:Setting>
</wsc:SettingsGroup>
<ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind BaseValueInfo.Values, Mode=OneWay}"> <ItemsControl VerticalAlignment="Top" ItemsSource="{x:Bind BaseValueInfo.Values, Mode=OneWay}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<wsc:Setting <clw:SettingsCard Margin="0,2,0,0" Header="{Binding Name}">
Margin="0,2,0,0" <TextBlock Text="{Binding Value}"/>
Padding="12,0" </clw:SettingsCard>
Header="{Binding Name}">
<wsc:Setting.ActionContent>
<TextBlock Text="{Binding Value}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>

View File

@@ -2,44 +2,42 @@
x:Class="Snap.Hutao.View.Control.DescParamComboBox" x:Class="Snap.Hutao.View.Control.DescParamComboBox"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls" xmlns:shcm="using:Snap.Hutao.Control.Markup"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox"> <Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
<Setter Property="MinWidth" Value="120"/> <Setter Property="MinWidth" Value="120"/>
</Style> </Style>
<Thickness x:Key="SettingsCardPadding">16,8</Thickness>
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
</UserControl.Resources> </UserControl.Resources>
<StackPanel> <StackPanel>
<wsc:SettingsGroup Margin="0,-64,0,0" VerticalAlignment="Top"> <StackPanel Margin="0,0,0,0" VerticalAlignment="Top">
<wsc:Setting Padding="12,0,6,0" Header="等级"> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewControlBaseValueSliderLevel}">
<wsc:Setting.ActionContent> <ComboBox x:Name="ItemHost" SelectionChanged="ItemHostSelectionChanged">
<ComboBox x:Name="ItemHost" SelectionChanged="ItemHostSelectionChanged"> <ComboBox.ItemTemplate>
<ComboBox.ItemTemplate> <DataTemplate>
<DataTemplate> <TextBlock Text="{Binding Level}"/>
<TextBlock Text="{Binding Level}"/> </DataTemplate>
</DataTemplate> </ComboBox.ItemTemplate>
</ComboBox.ItemTemplate> </ComboBox>
</ComboBox> </clw:SettingsCard>
</wsc:Setting.ActionContent> </StackPanel>
</wsc:Setting>
</wsc:SettingsGroup>
<ItemsControl x:Name="DetailsHost" VerticalAlignment="Top"> <ItemsControl x:Name="DetailsHost" VerticalAlignment="Top">
<ItemsControl.ItemContainerTransitions> <ItemsControl.ItemContainerTransitions>
<ContentThemeTransition/> <TransitionCollection>
<ContentThemeTransition/>
</TransitionCollection>
</ItemsControl.ItemContainerTransitions> </ItemsControl.ItemContainerTransitions>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<wsc:Setting <clw:SettingsCard Margin="0,3,0,0" Header="{Binding Description}">
Margin="0,2,0,0" <TextBlock Text="{Binding Parameter}"/>
Padding="12,0" </clw:SettingsCard>
Header="{Binding Description}">
<wsc:Setting.ActionContent>
<TextBlock Text="{Binding Parameter}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>

View File

@@ -2,11 +2,11 @@
x:Class="Snap.Hutao.View.Dialog.DailyNoteNotificationDialog" x:Class="Snap.Hutao.View.Dialog.DailyNoteNotificationDialog"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shme="using:Snap.Hutao.Model.Entity" xmlns:shme="using:Snap.Hutao.Model.Entity"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
Title="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationTitle}" Title="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationTitle}"
d:DataContext="{d:DesignInstance shme:DailyNoteEntry}" d:DataContext="{d:DesignInstance shme:DailyNoteEntry}"
DefaultButton="Primary" DefaultButton="Primary"
@@ -14,34 +14,35 @@
Style="{StaticResource DefaultContentDialogStyle}" Style="{StaticResource DefaultContentDialogStyle}"
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer> <ScrollViewer>
<wsc:SettingsGroup Margin="0,-24,0,0" Header="{Binding UserGameRole}"> <StackPanel>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationResinNotifyThreshold}"> <TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{Binding UserGameRole}"/>
<clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationResinNotifyThreshold}">
<Slider <Slider
MinWidth="160" MinWidth="160"
Margin="32,0,0,0" Margin="32,0,0,0"
Maximum="160" Maximum="160"
Minimum="0" Minimum="0"
Value="{Binding ResinNotifyThreshold, Mode=TwoWay}"/> Value="{Binding ResinNotifyThreshold, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationHomeCoinNotifyThreshold}"> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationHomeCoinNotifyThreshold}">
<Slider <Slider
MinWidth="160" MinWidth="160"
Maximum="2400" Maximum="2400"
Minimum="0" Minimum="0"
Value="{Binding HomeCoinNotifyThreshold, Mode=TwoWay}"/> Value="{Binding HomeCoinNotifyThreshold, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationTransformerNotify}"> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationTransformerNotify}">
<ToggleSwitch IsOn="{Binding TransformerNotify, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/> <ToggleSwitch IsOn="{Binding TransformerNotify, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationDailyTaskNotify}"> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationDailyTaskNotify}">
<ToggleSwitch IsOn="{Binding DailyTaskNotify, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/> <ToggleSwitch IsOn="{Binding DailyTaskNotify, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationExpeditionNotify}"> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationExpeditionNotify}">
<ToggleSwitch IsOn="{Binding ExpeditionNotify, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/> <ToggleSwitch IsOn="{Binding ExpeditionNotify, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationShowInHomeWidget}"> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewDialogDailyNoteNotificationShowInHomeWidget}">
<ToggleSwitch IsOn="{Binding ShowInHomeWidget, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/> <ToggleSwitch IsOn="{Binding ShowInHomeWidget, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup> </StackPanel>
</ScrollViewer> </ScrollViewer>
</ContentDialog> </ContentDialog>

View File

@@ -2,11 +2,11 @@
x:Class="Snap.Hutao.View.Dialog.UserDialog" x:Class="Snap.Hutao.View.Dialog.UserDialog"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls" Title="{shcm:ResourceString Name=ViewDialogUserTitle}"
Title="设置 Cookie"
CloseButtonText="{shcm:ResourceString Name=ContentDialogCancelCloseButtonText}" CloseButtonText="{shcm:ResourceString Name=ContentDialogCancelCloseButtonText}"
DefaultButton="Primary" DefaultButton="Primary"
IsPrimaryButtonEnabled="False" IsPrimaryButtonEnabled="False"
@@ -21,18 +21,18 @@
VerticalAlignment="Top" VerticalAlignment="Top"
PlaceholderText="{shcm:ResourceString Name=ViewDialogUserInputPlaceholder}" PlaceholderText="{shcm:ResourceString Name=ViewDialogUserInputPlaceholder}"
TextChanged="InputTextChanged"/> TextChanged="InputTextChanged"/>
<wsc:SettingsGroup Margin="0,-48,0,0"> <StackPanel Margin="0,-48,0,0">
<wsc:Setting <clw:SettingsCard
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Description="{shcm:ResourceString Name=ViewDialogUserDocumentDescription}" Description="{shcm:ResourceString Name=ViewDialogUserDocumentDescription}"
Header="{shcm:ResourceString Name=ViewDialogUserDocumentHeader}" Header="{shcm:ResourceString Name=ViewDialogUserDocumentHeader}"
Icon="&#xEB41;"> HeaderIcon="{shcm:FontIcon Glyph=&#xEB41;}">
<HyperlinkButton <HyperlinkButton
Margin="12,0,0,0" Margin="12,0,0,0"
Padding="6" Padding="6"
Content="{shcm:ResourceString Name=ViewDialogUserDocumentAction}" Content="{shcm:ResourceString Name=ViewDialogUserDocumentAction}"
NavigateUri="{StaticResource DocumentLink_MhyAccountSwitch}"/> NavigateUri="{StaticResource DocumentLink_MhyAccountSwitch}"/>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup> </StackPanel>
</StackPanel> </StackPanel>
</ContentDialog> </ContentDialog>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.AvatarPropertyPage" x:Class="Snap.Hutao.View.Page.AvatarPropertyPage"
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:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwu="using:CommunityToolkit.WinUI.UI" xmlns:cwu="using:CommunityToolkit.WinUI.UI"
xmlns:cwua="using:CommunityToolkit.WinUI.UI.Animations" xmlns:cwua="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls" xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls"
@@ -17,7 +18,6 @@
xmlns:shct="using:Snap.Hutao.Control.Text" xmlns:shct="using:Snap.Hutao.Control.Text"
xmlns:shva="using:Snap.Hutao.ViewModel.AvatarProperty" xmlns:shva="using:Snap.Hutao.ViewModel.AvatarProperty"
xmlns:shvcont="using:Snap.Hutao.View.Control" xmlns:shvcont="using:Snap.Hutao.View.Control"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shva:AvatarPropertyViewModel}" d:DataContext="{d:DesignInstance shva:AvatarPropertyViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -359,18 +359,18 @@
<Button.Flyout> <Button.Flyout>
<Flyout Placement="BottomEdgeAlignedLeft"> <Flyout Placement="BottomEdgeAlignedLeft">
<StackPanel> <StackPanel>
<wsc:Setting <clw:SettingsCard
Margin="0,2,0,0" Margin="0,2,0,0"
Padding="12,0" Padding="12,0"
Header="{Binding MainProperty.Name}"> Header="{Binding MainProperty.Name}">
<TextBlock Text="{Binding MainProperty.Value}"/> <TextBlock Text="{Binding MainProperty.Value}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting <clw:SettingsCard
Margin="0,2,0,0" Margin="0,2,0,0"
Padding="12,0" Padding="12,0"
Header="{Binding SubProperty.Name}"> Header="{Binding SubProperty.Name}">
<TextBlock Text="{Binding SubProperty.Description}"/> <TextBlock Text="{Binding SubProperty.Description}"/>
</wsc:Setting> </clw:SettingsCard>
<shct:DescriptionTextBlock <shct:DescriptionTextBlock
MaxWidth="320" MaxWidth="320"
Margin="0,12,0,0" Margin="0,12,0,0"
@@ -518,14 +518,12 @@
<ItemsControl Margin="0,12,0,0" ItemsSource="{Binding Info.Parameters}"> <ItemsControl Margin="0,12,0,0" ItemsSource="{Binding Info.Parameters}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<wsc:Setting <clw:SettingsCard
Margin="0,2,0,0" Margin="0,2,0,0"
Padding="12,0" Padding="12,0"
Header="{Binding Description}"> Header="{Binding Description}">
<wsc:Setting.ActionContent> <TextBlock Text="{Binding Parameter}"/>
<TextBlock Text="{Binding Parameter}"/> </clw:SettingsCard>
</wsc:Setting.ActionContent>
</wsc:Setting>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
@@ -541,6 +539,7 @@
<!-- 角色属性 --> <!-- 角色属性 -->
<Expander <Expander
Margin="16,0,16,0" Margin="16,0,16,0"
Padding="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
Background="{x:Null}" Background="{x:Null}"
@@ -756,17 +755,29 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource SubtitleTextBlockStyle}" Style="{StaticResource SubtitleTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewPageAvatarPropertyDefaultDescription}"/> Text="{shcm:ResourceString Name=ViewPageAvatarPropertyDefaultDescription}"/>
<wsc:SettingsGroup Margin="0,-36,0,0" HorizontalAlignment="Center"> <StackPanel
<wsc:Setting Description="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromEnkaApiDescription}" Header="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromEnkaApi}"> Margin="0,24,0,0"
<Button Command="{Binding RefreshFromEnkaApiCommand}" Content="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshAction}"/> HorizontalAlignment="Center"
</wsc:Setting> Spacing="{StaticResource SettingsCardSpacing}">
<wsc:Setting Description="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabGameRecordDescription}" Header="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabGameRecord}"> <clw:SettingsCard
<Button Command="{Binding RefreshFromHoyolabGameRecordCommand}" Content="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshAction}"/> ActionIconToolTip="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshAction}"
</wsc:Setting> Command="{Binding RefreshFromEnkaApiCommand}"
<wsc:Setting Description="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabCalculateDescription}" Header="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabCalculate}"> Description="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromEnkaApiDescription}"
<Button Command="{Binding RefreshFromHoyolabCalculateCommand}" Content="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshAction}"/> Header="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromEnkaApi}"
</wsc:Setting> IsClickEnabled="True"/>
</wsc:SettingsGroup> <clw:SettingsCard
ActionIconToolTip="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshAction}"
Command="{Binding RefreshFromHoyolabGameRecordCommand}"
Description="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabGameRecordDescription}"
Header="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabGameRecord}"
IsClickEnabled="True"/>
<clw:SettingsCard
ActionIconToolTip="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshAction}"
Command="{Binding RefreshFromHoyolabCalculateCommand}"
Description="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabCalculateDescription}"
Header="{shcm:ResourceString Name=ViewPageAvatarPropertyRefreshFromHoyolabCalculate}"
IsClickEnabled="True"/>
</StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.CultivationPage" x:Class="Snap.Hutao.View.Page.CultivationPage"
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:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwua="using:CommunityToolkit.WinUI.UI.Animations" xmlns:cwua="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls" xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:cwuconv="using:CommunityToolkit.WinUI.UI.Converters" xmlns:cwuconv="using:CommunityToolkit.WinUI.UI.Converters"
@@ -16,7 +17,6 @@
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shvco="using:Snap.Hutao.View.Control" xmlns:shvco="using:Snap.Hutao.View.Control"
xmlns:shvcu="using:Snap.Hutao.ViewModel.Cultivation" xmlns:shvcu="using:Snap.Hutao.ViewModel.Cultivation"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shvcu:CultivationViewModel}" d:DataContext="{d:DesignInstance shvcu:CultivationViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -284,35 +284,35 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Visibility="{Binding CultivateEntries.Count, Converter={StaticResource Int32ToVisibilityRevertConverter}}"> Visibility="{Binding CultivateEntries.Count, Converter={StaticResource Int32ToVisibilityRevertConverter}}">
<wsc:SettingsGroup Margin="0,-36,0,0" HorizontalAlignment="Center"> <StackPanel HorizontalAlignment="Center">
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageCultivationWikiAvatarDescription}" Description="{shcm:ResourceString Name=ViewPageCultivationWikiAvatarDescription}"
Header="{shcm:ResourceString Name=ViewWikiAvatarHeader}" Header="{shcm:ResourceString Name=ViewWikiAvatarHeader}"
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BagTabIcon_Avatar.png}"> HeaderIcon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BagTabIcon_Avatar.png}">
<Button <Button
Command="{Binding NavigateToPageCommand}" Command="{Binding NavigateToPageCommand}"
CommandParameter="Snap.Hutao.View.Page.WikiAvatarPage" CommandParameter="Snap.Hutao.View.Page.WikiAvatarPage"
Content="{shcm:ResourceString Name=ViewPageCultivationNavigateAction}"/> Content="{shcm:ResourceString Name=ViewPageCultivationNavigateAction}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageCultivationWikiWeaponDescription}" Description="{shcm:ResourceString Name=ViewPageCultivationWikiWeaponDescription}"
Header="{shcm:ResourceString Name=ViewWikiWeaponHeader}" Header="{shcm:ResourceString Name=ViewWikiWeaponHeader}"
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BagTabIcon_Weapon.png}"> HeaderIcon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BagTabIcon_Weapon.png}">
<Button <Button
Command="{Binding NavigateToPageCommand}" Command="{Binding NavigateToPageCommand}"
CommandParameter="Snap.Hutao.View.Page.WikiWeaponPage" CommandParameter="Snap.Hutao.View.Page.WikiWeaponPage"
Content="{shcm:ResourceString Name=ViewPageCultivationNavigateAction}"/> Content="{shcm:ResourceString Name=ViewPageCultivationNavigateAction}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageCultivationAvatarPropertyDescription}" Description="{shcm:ResourceString Name=ViewPageCultivationAvatarPropertyDescription}"
Header="{shcm:ResourceString Name=ViewAvatarPropertyHeader}" Header="{shcm:ResourceString Name=ViewAvatarPropertyHeader}"
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_Icon_BoostUp.png}"> HeaderIcon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_Icon_BoostUp.png}">
<Button <Button
Command="{Binding NavigateToPageCommand}" Command="{Binding NavigateToPageCommand}"
CommandParameter="Snap.Hutao.View.Page.AvatarPropertyPage" CommandParameter="Snap.Hutao.View.Page.AvatarPropertyPage"
Content="{shcm:ResourceString Name=ViewPageCultivationNavigateAction}"/> Content="{shcm:ResourceString Name=ViewPageCultivationNavigateAction}"/>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup> </StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>
</PivotItem> </PivotItem>
@@ -371,14 +371,15 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource SubtitleTextBlockStyle}" Style="{StaticResource SubtitleTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewPageCultivationAddProjectContinue}"/> Text="{shcm:ResourceString Name=ViewPageCultivationAddProjectContinue}"/>
<wsc:SettingsGroup Margin="0,-36,0,0" HorizontalAlignment="Center"> <StackPanel Margin="0,24,0,0" HorizontalAlignment="Center">
<wsc:Setting <clw:SettingsCard
ActionIconToolTip="{shcm:ResourceString Name=ViewPageCultivationAddProjectAction}"
Command="{Binding AddProjectCommand}"
Description="{shcm:ResourceString Name=ViewPageCultivationAddProjectDescription}" Description="{shcm:ResourceString Name=ViewPageCultivationAddProjectDescription}"
Header="{shcm:ResourceString Name=ViewPageCultivationAddProject}" Header="{shcm:ResourceString Name=ViewPageCultivationAddProject}"
Icon="{shcm:FontIcon Glyph=&#xE710;}"> HeaderIcon="{shcm:FontIcon Glyph=&#xE710;}"
<Button Command="{Binding AddProjectCommand}" Content="{shcm:ResourceString Name=ViewPageCultivationAddProjectAction}"/> IsClickEnabled="True"/>
</wsc:Setting> </StackPanel>
</wsc:SettingsGroup>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.DailyNotePage" x:Class="Snap.Hutao.View.Page.DailyNotePage"
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:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls" xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
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"
@@ -13,7 +14,6 @@
xmlns:shci="using:Snap.Hutao.Control.Image" xmlns:shci="using:Snap.Hutao.Control.Image"
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shv="using:Snap.Hutao.ViewModel" xmlns:shv="using:Snap.Hutao.ViewModel"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shv:DailyNoteViewModel}" d:DataContext="{d:DesignInstance shv:DailyNoteViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -95,26 +95,26 @@
</DataTemplate> </DataTemplate>
</RadioButtons.ItemTemplate> </RadioButtons.ItemTemplate>
</RadioButtons> </RadioButtons>
<wsc:SettingsGroup Margin="0,-16,0,0" Header="{shcm:ResourceString Name=ViewPageDailyNoteNotificationHeader}"> <StackPanel Spacing="{StaticResource SettingsCardSpacing}">
<wsc:Setting <StackPanel.Resources>
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
<x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
</StackPanel.Resources>
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageDailyNoteNotificationHeader}"/>
<clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageDailyNoteSlientModeDescription}" Description="{shcm:ResourceString Name=ViewPageDailyNoteSlientModeDescription}"
Header="{shcm:ResourceString Name=ViewPageDailyNoteSlientModeHeader}" Header="{shcm:ResourceString Name=ViewPageDailyNoteSlientModeHeader}"
Icon="&#xE7ED;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE7ED;}">
<ToggleSwitch <ToggleSwitch Margin="24,0,0,0" IsOn="{Binding IsSilentWhenPlayingGame, Mode=TwoWay}"/>
Margin="24,0,0,0" </clw:SettingsCard>
IsOn="{Binding IsSilentWhenPlayingGame, Mode=TwoWay}" <clw:SettingsCard
Style="{StaticResource ToggleSwitchSettingStyle}"/>
</wsc:Setting>
<wsc:Setting
Description="{shcm:ResourceString Name=ViewPageDailyNoteReminderDescription}" Description="{shcm:ResourceString Name=ViewPageDailyNoteReminderDescription}"
Header="{shcm:ResourceString Name=ViewPageDailyNoteReminderHeader}" Header="{shcm:ResourceString Name=ViewPageDailyNoteReminderHeader}"
Icon="&#xEA8F;"> HeaderIcon="{shcm:FontIcon Glyph=&#xEA8F;}">
<ToggleSwitch <ToggleSwitch Margin="24,0,0,0" IsOn="{Binding IsReminderNotification, Mode=TwoWay}"/>
Margin="24,0,0,0" </clw:SettingsCard>
IsOn="{Binding IsReminderNotification, Mode=TwoWay}" </StackPanel>
Style="{StaticResource ToggleSwitchSettingStyle}"/>
</wsc:Setting>
</wsc:SettingsGroup>
</StackPanel> </StackPanel>
</Flyout> </Flyout>
</AppBarButton.Flyout> </AppBarButton.Flyout>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.GachaLogPage" x:Class="Snap.Hutao.View.Page.GachaLogPage"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:mxi="using:Microsoft.Xaml.Interactivity" xmlns:mxi="using:Microsoft.Xaml.Interactivity"
@@ -12,7 +13,6 @@
xmlns:shcp="using:Snap.Hutao.Control.Panel" xmlns:shcp="using:Snap.Hutao.Control.Panel"
xmlns:shvc="using:Snap.Hutao.View.Control" xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog" xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shvg:GachaLogViewModel}" d:DataContext="{d:DesignInstance shvg:GachaLogViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -481,33 +481,39 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource SubtitleTextBlockStyle}" Style="{StaticResource SubtitleTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewPageGachaLogHint}"/> Text="{shcm:ResourceString Name=ViewPageGachaLogHint}"/>
<wsc:SettingsGroup Margin="0,-36,0,0" HorizontalAlignment="Center"> <StackPanel
<wsc:Setting Margin="0,24,0,0"
HorizontalAlignment="Center"
Spacing="{StaticResource SettingsCardSpacing}">
<clw:SettingsCard
ActionIconToolTip="{shcm:ResourceString Name=ViewPageGachaLogRefreshAction}"
Command="{Binding RefreshByStokenCommand}"
Description="{shcm:ResourceString Name=ViewPageGachaLogRefreshByStokenDescription}" Description="{shcm:ResourceString Name=ViewPageGachaLogRefreshByStokenDescription}"
Header="{shcm:ResourceString Name=ViewPageGachaLogRefreshByStoken}" Header="{shcm:ResourceString Name=ViewPageGachaLogRefreshByStoken}"
Icon="{shcm:FontIcon Glyph=&#xE192;}" HeaderIcon="{shcm:FontIcon Glyph=&#xE192;}"
Style="{StaticResource DefaultSettingStyle}"> IsClickEnabled="True"/>
<Button Command="{Binding RefreshByStokenCommand}" Content="{shcm:ResourceString Name=ViewPageGachaLogRefreshAction}"/> <clw:SettingsCard
</wsc:Setting> ActionIconToolTip="{shcm:ResourceString Name=ViewPageGachaLogRefreshAction}"
<wsc:Setting Command="{Binding RefreshByWebCacheCommand}"
Description="{shcm:ResourceString Name=ViewPageGachaLogRefreshByWebCacheDescription}" Description="{shcm:ResourceString Name=ViewPageGachaLogRefreshByWebCacheDescription}"
Header="{shcm:ResourceString Name=ViewPageGachaLogRefreshByWebCache}" Header="{shcm:ResourceString Name=ViewPageGachaLogRefreshByWebCache}"
Icon="{shcm:FontIcon Glyph=&#xE81E;}"> HeaderIcon="{shcm:FontIcon Glyph=&#xE81E;}"
<Button Command="{Binding RefreshByWebCacheCommand}" Content="{shcm:ResourceString Name=ViewPageGachaLogRefreshAction}"/> IsClickEnabled="True"/>
</wsc:Setting> <clw:SettingsCard
<wsc:Setting ActionIconToolTip="{shcm:ResourceString Name=ViewPageGachaLogInputAction}"
Command="{Binding RefreshByManualInputCommand}"
Description="{shcm:ResourceString Name=ViewPageGachaLogRefreshBymanualInputDescription}" Description="{shcm:ResourceString Name=ViewPageGachaLogRefreshBymanualInputDescription}"
Header="{shcm:ResourceString Name=ViewPageGachaLogRefreshBymanualInput}" Header="{shcm:ResourceString Name=ViewPageGachaLogRefreshBymanualInput}"
Icon="{shcm:FontIcon Glyph=&#xE765;}"> HeaderIcon="{shcm:FontIcon Glyph=&#xE765;}"
<Button Command="{Binding RefreshByManualInputCommand}" Content="{shcm:ResourceString Name=ViewPageGachaLogInputAction}"/> IsClickEnabled="True"/>
</wsc:Setting> <clw:SettingsCard
<wsc:Setting ActionIconToolTip="{shcm:ResourceString Name=ViewPageGachaLogImportAction}"
Command="{Binding ImportFromUIGFJsonCommand}"
Description="{shcm:ResourceString Name=ViewPageGachaLogImportDescription}" Description="{shcm:ResourceString Name=ViewPageGachaLogImportDescription}"
Header="{shcm:ResourceString Name=ViewPageGachaLogImportHeader}" Header="{shcm:ResourceString Name=ViewPageGachaLogImportHeader}"
Icon="{shcm:FontIcon Glyph=&#xE8B5;}"> HeaderIcon="{shcm:FontIcon Glyph=&#xE8B5;}"
<Button Command="{Binding ImportFromUIGFJsonCommand}" Content="{shcm:ResourceString Name=ViewPageGachaLogImportAction}"/> IsClickEnabled="True"/>
</wsc:Setting> </StackPanel>
</wsc:SettingsGroup>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.HutaoDatabasePage" x:Class="Snap.Hutao.View.Page.HutaoDatabasePage"
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:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls" xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
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"
@@ -11,7 +12,6 @@
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shvcom="using:Snap.Hutao.ViewModel.Complex" xmlns:shvcom="using:Snap.Hutao.ViewModel.Complex"
xmlns:shvcon="using:Snap.Hutao.View.Control" xmlns:shvcon="using:Snap.Hutao.View.Control"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shvcom:HutaoDatabaseViewModel}" d:DataContext="{d:DesignInstance shvcom:HutaoDatabaseViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -61,36 +61,43 @@
<AppBarButton Icon="{shcm:FontIcon Glyph=&#xE946;}" Label="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverview}"> <AppBarButton Icon="{shcm:FontIcon Glyph=&#xE946;}" Label="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverview}">
<AppBarButton.Flyout> <AppBarButton.Flyout>
<Flyout Placement="BottomEdgeAlignedRight"> <Flyout Placement="BottomEdgeAlignedRight">
<StackPanel MinWidth="260"> <StackPanel
<wsc:SettingsGroup Margin="0,-32,0,0" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewDataCollect}"> MinWidth="260"
<wsc:Setting Content="{Binding Overview.RefreshTime}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewRefreshTime}"/> Margin="0,-29,0,0"
<wsc:Setting Content="{Binding Overview.RecordTotal}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewRecordTotal}"/> Spacing="{StaticResource SettingsCardSpacing}">
</wsc:SettingsGroup> <StackPanel.Resources>
<wsc:SettingsGroup Margin="0,-16,0,0" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyss}"> <Thickness x:Key="SettingsCardPadding">16</Thickness>
<wsc:Setting Content="{Binding Overview.SpiralAbyssTotal}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssTotal}"/> <x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssPassed}"> <x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
<StackPanel> <x:Double x:Key="SettingsCardMinHeight">0</x:Double>
<TextBlock Text="{Binding Overview.SpiralAbyssPassedPercent}"/> </StackPanel.Resources>
<TextBlock <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewDataCollect}"/>
HorizontalAlignment="Right" <clw:SettingsCard Content="{Binding Overview.RefreshTime}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewRefreshTime}"/>
Opacity="0.7" <clw:SettingsCard Content="{Binding Overview.RecordTotal}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewRecordTotal}"/>
Style="{StaticResource CaptionTextBlockStyle}" <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyss}"/>
Text="{Binding Overview.SpiralAbyssPassed}"/> <clw:SettingsCard Content="{Binding Overview.SpiralAbyssTotal}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssTotal}"/>
</StackPanel> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssPassed}">
</wsc:Setting> <StackPanel>
<wsc:Setting Padding="16,8" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssFullStar}"> <TextBlock Text="{Binding Overview.SpiralAbyssPassedPercent}"/>
<StackPanel> <TextBlock
<TextBlock Text="{Binding Overview.SpiralAbyssFullStarPercent}"/> HorizontalAlignment="Right"
<TextBlock Opacity="0.7"
HorizontalAlignment="Right" Style="{StaticResource CaptionTextBlockStyle}"
Opacity="0.7" Text="{Binding Overview.SpiralAbyssPassed}"/>
Style="{StaticResource CaptionTextBlockStyle}" </StackPanel>
Text="{Binding Overview.SpiralAbyssFullStar}"/> </clw:SettingsCard>
</StackPanel> <clw:SettingsCard Padding="16,8" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssFullStar}">
</wsc:Setting> <StackPanel>
<wsc:Setting Content="{Binding Overview.SpiralAbyssStarAverage}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssStarAverage}"/> <TextBlock Text="{Binding Overview.SpiralAbyssFullStarPercent}"/>
<wsc:Setting Content="{Binding Overview.SpiralAbyssBattleAverage}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssBattleAverage}"/> <TextBlock
</wsc:SettingsGroup> HorizontalAlignment="Right"
Opacity="0.7"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Overview.SpiralAbyssFullStar}"/>
</StackPanel>
</clw:SettingsCard>
<clw:SettingsCard Content="{Binding Overview.SpiralAbyssStarAverage}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssStarAverage}"/>
<clw:SettingsCard Content="{Binding Overview.SpiralAbyssBattleAverage}" Header="{shcm:ResourceString Name=ViewPageHutaoDatabaseOverviewSpiralAbyssBattleAverage}"/>
</StackPanel> </StackPanel>
</Flyout> </Flyout>
</AppBarButton.Flyout> </AppBarButton.Flyout>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.LaunchGamePage" x:Class="Snap.Hutao.View.Page.LaunchGamePage"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:mxi="using:Microsoft.Xaml.Interactivity" xmlns:mxi="using:Microsoft.Xaml.Interactivity"
@@ -12,7 +13,6 @@
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shvc="using:Snap.Hutao.View.Control" xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvg="using:Snap.Hutao.ViewModel.Game" xmlns:shvg="using:Snap.Hutao.ViewModel.Game"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shvg:LaunchGameViewModel}" d:DataContext="{d:DesignInstance shvg:LaunchGameViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -24,16 +24,6 @@
<Page.Resources> <Page.Resources>
<shc:BindingProxy x:Key="BindingProxy" DataContext="{Binding}"/> <shc:BindingProxy x:Key="BindingProxy" DataContext="{Binding}"/>
<Visibility x:Key="VisibilityCollapsed">Collapsed</Visibility> <Visibility x:Key="VisibilityCollapsed">Collapsed</Visibility>
<Style BasedOn="{StaticResource SettingButtonStyle}" TargetType="Button">
<Setter Property="MinWidth" Value="156"/>
</Style>
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
<Setter Property="MinWidth" Value="156"/>
</Style>
<Style TargetType="NumberBox">
<Setter Property="MinWidth" Value="156"/>
</Style>
</Page.Resources> </Page.Resources>
<Grid> <Grid>
<Rectangle <Rectangle
@@ -62,247 +52,189 @@
<ColumnDefinition MaxWidth="1000"/> <ColumnDefinition MaxWidth="1000"/>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Margin="16"> <StackPanel Margin="16" Spacing="{StaticResource SettingsCardSpacing}">
<InfoBar <InfoBar
IsClosable="False" IsClosable="False"
IsOpen="True" IsOpen="True"
Message="{shcm:ResourceString Name=ViewPageLaunchGameConfigurationSaveHint}" Message="{shcm:ResourceString Name=ViewPageLaunchGameConfigurationSaveHint}"
Severity="Informational"/> Severity="Informational"/>
<InfoBar <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageLaunchGameCommonHeader}"/>
Margin="0,2,0,0" <clw:SettingsCard
IsClosable="False" Description="{shcm:ResourceString Name=ViewPageLaunchGameSwitchSchemeDescription}"
IsOpen="{Binding IsElevated, Converter={StaticResource BoolNegationConverter}}" Header="{shcm:ResourceString Name=ViewPageLaunchGameSwitchSchemeHeader}"
Message="{shcm:ResourceString Name=ViewPageLaunchGameElevationHint}" HeaderIcon="{shcm:FontIcon Glyph=&#xE8AB;}"
Severity="Warning"/> IsEnabled="{Binding IsElevated}">
<wsc:SettingsGroup Margin="0,0,0,0" Header="{shcm:ResourceString Name=ViewPageLaunchGameCommonHeader}"> <ComboBox
<wsc:Setting DisplayMemberPath="DisplayName"
Description="{shcm:ResourceString Name=ViewPageLaunchGameSwitchSchemeDescription}" ItemsSource="{Binding KnownSchemes}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameSwitchSchemeHeader}" SelectedItem="{Binding SelectedScheme, Mode=TwoWay}"/>
Icon="&#xE8AB;" </clw:SettingsCard>
IsEnabled="{Binding IsElevated}"> <clw:SettingsCard
<wsc:Setting.ActionContent> ActionIconToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountDetectAction}"
<ComboBox Command="{Binding DetectGameAccountCommand}"
DisplayMemberPath="DisplayName" Description="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountDescription}"
ItemsSource="{Binding KnownSchemes}" Header="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountHeader}"
SelectedItem="{Binding SelectedScheme, Mode=TwoWay}"/> HeaderIcon="{shcm:FontIcon Glyph=&#xE748;}"
</wsc:Setting.ActionContent> IsClickEnabled="True"/>
</wsc:Setting> <Border Style="{StaticResource BorderCardStyle}">
<wsc:SettingExpander IsExpanded="True"> <ListView ItemsSource="{Binding GameAccounts}" SelectedItem="{Binding SelectedGameAccount, Mode=TwoWay}">
<wsc:SettingExpander.Header> <ListView.ItemTemplate>
<wsc:Setting <DataTemplate>
Description="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountDescription}" <Grid>
Header="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountHeader}" <StackPanel Margin="0,12">
Icon="&#xE748;"> <TextBlock Text="{Binding Name}"/>
<wsc:Setting.ActionContent> <TextBlock
<Button Opacity="0.8"
Grid.Column="1" Style="{StaticResource CaptionTextBlockStyle}"
MinWidth="124" Text="{Binding AttachUid, TargetNullValue={shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountAttachUidNull}}"/>
Margin="0,0,8,0" </StackPanel>
<StackPanel
x:Name="ButtonPanel"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Command="{Binding DetectGameAccountCommand}" Orientation="Horizontal"
Content="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountDetectAction}"/> Visibility="Collapsed">
</wsc:Setting.ActionContent> <Button
</wsc:Setting> MinWidth="48"
</wsc:SettingExpander.Header> Margin="4,8"
<ListView ItemsSource="{Binding GameAccounts}" SelectedItem="{Binding SelectedGameAccount, Mode=TwoWay}"> VerticalAlignment="Stretch"
<ListView.ItemTemplate> Command="{Binding DataContext.AttachGameAccountCommand, Source={StaticResource BindingProxy}}"
<DataTemplate> CommandParameter="{Binding}"
<Grid> Content="&#xE723;"
<StackPanel Margin="0,12"> FontFamily="{StaticResource SymbolThemeFontFamily}"
<TextBlock Text="{Binding Name}"/> ToolTipService.ToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountAttachUidToolTip}"/>
<TextBlock <Button
Opacity="0.8" MinWidth="48"
Style="{StaticResource CaptionTextBlockStyle}" Margin="4,8"
Text="{Binding AttachUid, TargetNullValue={shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountAttachUidNull}}"/> VerticalAlignment="Stretch"
</StackPanel> Command="{Binding DataContext.ModifyGameAccountCommand, Source={StaticResource BindingProxy}}"
<StackPanel CommandParameter="{Binding}"
x:Name="ButtonPanel" Content="&#xE8AC;"
HorizontalAlignment="Right" FontFamily="{StaticResource SymbolThemeFontFamily}"
Orientation="Horizontal" ToolTipService.ToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountRenameToolTip}"/>
Visibility="Collapsed"> <Button
<Button MinWidth="48"
MinWidth="48" Margin="4,8,0,8"
Margin="4,8" VerticalAlignment="Stretch"
VerticalAlignment="Stretch" Command="{Binding DataContext.RemoveGameAccountCommand, Source={StaticResource BindingProxy}}"
Command="{Binding DataContext.AttachGameAccountCommand, Source={StaticResource BindingProxy}}" CommandParameter="{Binding}"
CommandParameter="{Binding}" Content="&#xE74D;"
Content="&#xE723;" FontFamily="{StaticResource SymbolThemeFontFamily}"
FontFamily="{StaticResource SymbolThemeFontFamily}" ToolTipService.ToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountRemoveToolTip}"/>
ToolTipService.ToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountAttachUidToolTip}"/> </StackPanel>
<Button
MinWidth="48"
Margin="4,8"
VerticalAlignment="Stretch"
Command="{Binding DataContext.ModifyGameAccountCommand, Source={StaticResource BindingProxy}}"
CommandParameter="{Binding}"
Content="&#xE8AC;"
FontFamily="{StaticResource SymbolThemeFontFamily}"
ToolTipService.ToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountRenameToolTip}"/>
<Button
MinWidth="48"
Margin="4,8,0,8"
VerticalAlignment="Stretch"
Command="{Binding DataContext.RemoveGameAccountCommand, Source={StaticResource BindingProxy}}"
CommandParameter="{Binding}"
Content="&#xE74D;"
FontFamily="{StaticResource SymbolThemeFontFamily}"
ToolTipService.ToolTip="{shcm:ResourceString Name=ViewPageLaunchGameSwitchAccountRemoveToolTip}"/>
</StackPanel>
<Grid.Resources> <Grid.Resources>
<Storyboard x:Name="ButtonPanelVisibleStoryboard"> <Storyboard x:Name="ButtonPanelVisibleStoryboard">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility"> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value> <DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility> <Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame> </DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames> </ObjectAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
<Storyboard x:Name="ButtonPanelCollapsedStoryboard"> <Storyboard x:Name="ButtonPanelCollapsedStoryboard">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility"> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value> <DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility> <Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame> </DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames> </ObjectAnimationUsingKeyFrames>
</Storyboard> </Storyboard>
</Grid.Resources> </Grid.Resources>
<mxi:Interaction.Behaviors> <mxi:Interaction.Behaviors>
<mxic:EventTriggerBehavior EventName="PointerEntered"> <mxic:EventTriggerBehavior EventName="PointerEntered">
<mxim:ControlStoryboardAction Storyboard="{StaticResource ButtonPanelVisibleStoryboard}"/> <mxim:ControlStoryboardAction Storyboard="{StaticResource ButtonPanelVisibleStoryboard}"/>
</mxic:EventTriggerBehavior> </mxic:EventTriggerBehavior>
<mxic:EventTriggerBehavior EventName="PointerExited"> <mxic:EventTriggerBehavior EventName="PointerExited">
<mxim:ControlStoryboardAction Storyboard="{StaticResource ButtonPanelCollapsedStoryboard}"/> <mxim:ControlStoryboardAction Storyboard="{StaticResource ButtonPanelCollapsedStoryboard}"/>
</mxic:EventTriggerBehavior> </mxic:EventTriggerBehavior>
</mxi:Interaction.Behaviors> </mxi:Interaction.Behaviors>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </ListView.ItemTemplate>
</ListView> </ListView>
</wsc:SettingExpander> </Border>
</wsc:SettingsGroup>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceHeader}">
<wsc:Setting
Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceExclusiveDescription}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceExclusiveHeader}"
Icon="&#xE740;">
<wsc:Setting.ActionContent>
<ToggleSwitch
Width="120"
IsOn="{Binding Options.IsExclusive, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchSettingStyle}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
<wsc:Setting
Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceFullscreenDescription}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceFullscreenHeader}"
Icon="&#xE740;">
<wsc:Setting.ActionContent>
<ToggleSwitch
Width="120"
IsOn="{Binding Options.IsFullScreen, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchSettingStyle}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
<wsc:Setting
Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceBorderlessDescription}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceBorderlessHeader}"
Icon="&#xE737;">
<wsc:Setting.ActionContent>
<ToggleSwitch
Width="120"
IsOn="{Binding Options.IsBorderless, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchSettingStyle}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
<wsc:Setting <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceHeader}"/>
Margin="0,6,0,0" <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenWidthDescription}" Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceExclusiveDescription}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenWidthHeader}" Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceExclusiveHeader}"
Icon="&#xE76F;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE740;}">
<wsc:Setting.ActionContent> <ToggleSwitch Width="120" IsOn="{Binding Options.IsExclusive, Mode=TwoWay}"/>
<NumberBox Width="156" Value="{Binding Options.ScreenWidth, Mode=TwoWay}"/> </clw:SettingsCard>
</wsc:Setting.ActionContent> <clw:SettingsCard
</wsc:Setting> Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceFullscreenDescription}"
<wsc:Setting Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceFullscreenHeader}"
Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenHeightDescription}" HeaderIcon="{shcm:FontIcon Glyph=&#xE740;}">
Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenHeightHeader}" <ToggleSwitch Width="120" IsOn="{Binding Options.IsFullScreen, Mode=TwoWay}"/>
Icon="&#xE784;"> </clw:SettingsCard>
<wsc:Setting.ActionContent> <clw:SettingsCard
<NumberBox Width="156" Value="{Binding Options.ScreenHeight, Mode=TwoWay}"/> Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceBorderlessDescription}"
</wsc:Setting.ActionContent> Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceBorderlessHeader}"
</wsc:Setting> HeaderIcon="{shcm:FontIcon Glyph=&#xE737;}">
<ToggleSwitch Width="120" IsOn="{Binding Options.IsBorderless, Mode=TwoWay}"/>
</clw:SettingsCard>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageLaunchGameMonitorsDescription}" Margin="0,6,0,0"
Header="{shcm:ResourceString Name=ViewPageLaunchGameMonitorsHeader}" Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenWidthDescription}"
Icon="&#xE975;"> Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenWidthHeader}"
<wsc:Setting.ActionContent> HeaderIcon="{shcm:FontIcon Glyph=&#xE76F;}">
<ComboBox <NumberBox Width="156" Value="{Binding Options.ScreenWidth, Mode=TwoWay}"/>
DisplayMemberPath="Name" </clw:SettingsCard>
ItemsSource="{Binding Options.Monitors}" <clw:SettingsCard
SelectedItem="{Binding Options.Monitor, Mode=TwoWay}"/> Description="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenHeightDescription}"
</wsc:Setting.ActionContent> Header="{shcm:ResourceString Name=ViewPageLaunchGameAppearanceScreenHeightHeader}"
</wsc:Setting> HeaderIcon="{shcm:FontIcon Glyph=&#xE784;}">
</wsc:SettingsGroup> <NumberBox Width="156" Value="{Binding Options.ScreenHeight, Mode=TwoWay}"/>
</clw:SettingsCard>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageLaunchGameAdvanceHeader}" IsEnabled="{Binding AppOptions.IsAdvancedLaunchOptionsEnabled}"> <clw:SettingsCard
<InfoBar Description="{shcm:ResourceString Name=ViewPageLaunchGameMonitorsDescription}"
IsClosable="False" Header="{shcm:ResourceString Name=ViewPageLaunchGameMonitorsHeader}"
IsOpen="{Binding AppOptions.IsAdvancedLaunchOptionsEnabled}" HeaderIcon="{shcm:FontIcon Glyph=&#xE975;}">
Message="{shcm:ResourceString Name=ViewPageLaunchGameAdvanceHint}" <ComboBox
Severity="Error"/> Width="156"
<InfoBar DisplayMemberPath="Name"
Margin="0,2,0,0" ItemsSource="{Binding Options.Monitors}"
IsClosable="False" SelectedItem="{Binding Options.Monitor, Mode=TwoWay}"/>
IsOpen="{Binding AppOptions.IsAdvancedLaunchOptionsEnabled, Converter={StaticResource BoolNegationConverter}}" </clw:SettingsCard>
Message="{shcm:ResourceString Name=ViewPageLaunchGameAdvancedFeatureElevationHint}"
Severity="Warning"/> <StackPanel Spacing="{StaticResource SettingsCardSpacing}" Visibility="{Binding AppOptions.IsAdvancedLaunchOptionsEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
<wsc:Setting <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageLaunchGameAdvanceHeader}"/>
<clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageLaunchGameMultipleInstancesDescription}" Description="{shcm:ResourceString Name=ViewPageLaunchGameMultipleInstancesDescription}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameMultipleInstancesHeader}" Header="{shcm:ResourceString Name=ViewPageLaunchGameMultipleInstancesHeader}"
Icon="&#xE7C4;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE7C4;}">
<wsc:Setting.ActionContent> <ToggleSwitch Width="120" IsOn="{Binding Options.MultipleInstances, Mode=TwoWay}"/>
<ToggleSwitch </clw:SettingsCard>
Width="120" <clw:SettingsCard
IsOn="{Binding Options.MultipleInstances, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchSettingStyle}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
<wsc:Setting
Description="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsDescription}" Description="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsDescription}"
Header="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsHeader}" Header="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsHeader}"
Icon="&#xE785;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE785;}">
<wsc:Setting.ActionContent> <ToggleSwitch
<ToggleSwitch Width="120"
Width="120" IsOn="{Binding Options.UnlockFps, Mode=TwoWay}"
IsOn="{Binding Options.UnlockFps, Mode=TwoWay}" OffContent="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsOff}"
OffContent="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsOff}" OnContent="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsOn}"/>
OnContent="{shcm:ResourceString Name=ViewPageLaunchGameUnlockFpsOn}" </clw:SettingsCard>
Style="{StaticResource ToggleSwitchSettingStyle}"/> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewPageLaunchGameSetFpsHeader}">
</wsc:Setting.ActionContent> <clw:SettingsCard.Description>
</wsc:Setting>
<wsc:Setting Header="{shcm:ResourceString Name=ViewPageLaunchGameSetFpsHeader}">
<wsc:Setting.Description>
<StackPanel> <StackPanel>
<TextBlock Text="{shcm:ResourceString Name=ViewPageLaunchGameSetFpsDescription}"/> <TextBlock Text="{shcm:ResourceString Name=ViewPageLaunchGameSetFpsDescription}"/>
<TextBlock Text="{Binding Options.TargetFps}"/> <TextBlock Text="{Binding Options.TargetFps}"/>
</StackPanel> </StackPanel>
</wsc:Setting.Description> </clw:SettingsCard.Description>
<wsc:Setting.ActionContent> <Slider
<Slider Width="400"
Width="400" Maximum="360"
Maximum="360" Minimum="60"
Minimum="60" Value="{Binding Options.TargetFps, Mode=TwoWay}"/>
Value="{Binding Options.TargetFps, Mode=TwoWay}"/> </clw:SettingsCard>
</wsc:Setting.ActionContent> </StackPanel>
</wsc:Setting>
</wsc:SettingsGroup>
</StackPanel> </StackPanel>
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>

View File

@@ -2,35 +2,22 @@
x:Class="Snap.Hutao.View.Page.SettingPage" x:Class="Snap.Hutao.View.Page.SettingPage"
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:cwuc="using:CommunityToolkit.WinUI.UI.Controls" xmlns:clw="using:CommunityToolkit.Labs.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"
xmlns:shc="using:Snap.Hutao.Control" xmlns:shc="using:Snap.Hutao.Control"
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shv="using:Snap.Hutao.ViewModel" xmlns:shv="using:Snap.Hutao.ViewModel"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shv:SettingViewModel}" d:DataContext="{d:DesignInstance shv:SettingViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
<Page.Resources>
<Style BasedOn="{StaticResource SettingButtonStyle}" TargetType="Button">
<Setter Property="MinWidth" Value="160"/>
</Style>
<Style BasedOn="{StaticResource HyperlinkButtonStyle}" TargetType="HyperlinkButton">
<Setter Property="MinWidth" Value="120"/>
<Setter Property="CornerRadius" Value="{StaticResource ControlCornerRadius}"/>
</Style>
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
<Setter Property="MinWidth" Value="160"/>
</Style>
</Page.Resources>
<ScrollViewer> <ScrollViewer>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="1000"/> <ColumnDefinition MaxWidth="1000"/>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Margin="16,16,24,16"> <StackPanel Margin="16,16,24,16" Spacing="{StaticResource SettingsCardSpacing}">
<Border Height="240" Style="{StaticResource BorderCardStyle}"> <Border Height="240" Style="{StaticResource BorderCardStyle}">
<Grid> <Grid>
<Image <Image
@@ -42,215 +29,202 @@
</Grid> </Grid>
</Grid> </Grid>
</Border> </Border>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageSettingAboutHeader}"> <TextBlock
<Grid Margin="0,4,0,16" RowSpacing="8"> Grid.Row="0"
<Grid.RowDefinitions> Text="Copyright © 2022 - 2023 DGP Studio. All Rights Reserved."
<RowDefinition/> TextWrapping="Wrap"/>
<RowDefinition Height="auto"/> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageSettingAboutHeader}"/>
</Grid.RowDefinitions> <Grid Margin="0,4,0,16" RowSpacing="8">
<TextBlock <Grid.RowDefinitions>
Grid.Row="0" <RowDefinition/>
Text="Copyright © 2022 - 2023 DGP Studio. All Rights Reserved." <RowDefinition Height="auto"/>
TextWrapping="Wrap"/> </Grid.RowDefinitions>
<StackPanel <StackPanel
Grid.Row="1" Grid.Row="1"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{shcm:ResourceString Name=ViewPageSettingLinks}"/> <TextBlock VerticalAlignment="Center" Text="{shcm:ResourceString Name=ViewPageSettingLinks}"/>
<HyperlinkButton <HyperlinkButton
Margin="12,0,0,0" Margin="12,0,0,0"
Command="{Binding UpdateCheckCommand}" Command="{Binding UpdateCheckCommand}"
Content="{shcm:ResourceString Name=ViewPageSettingUpdateCheckAction}"/> Content="{shcm:ResourceString Name=ViewPageSettingUpdateCheckAction}"/>
<HyperlinkButton <HyperlinkButton
Margin="12,0,0,0" Margin="12,0,0,0"
Content="{shcm:ResourceString Name=ViewPageSettingFeedbackNavigate}" Content="{shcm:ResourceString Name=ViewPageSettingFeedbackNavigate}"
NavigateUri="{StaticResource DocumentLink_BugReport}"/> NavigateUri="{StaticResource DocumentLink_BugReport}"/>
<HyperlinkButton <HyperlinkButton
Margin="12,0,0,0" Margin="12,0,0,0"
Content="{shcm:ResourceString Name=ViewPageSettingTranslateNavigate}" Content="{shcm:ResourceString Name=ViewPageSettingTranslateNavigate}"
NavigateUri="{StaticResource DocumentLink_Translate}"/> NavigateUri="{StaticResource DocumentLink_Translate}"/>
<HyperlinkButton <HyperlinkButton
Margin="12,0,0,0" Margin="12,0,0,0"
Content="{shcm:ResourceString Name=ViewPageSettingSponsorNavigate}" Content="{shcm:ResourceString Name=ViewPageSettingSponsorNavigate}"
NavigateUri="{StaticResource Sponsor_Afadian}"/> NavigateUri="{StaticResource Sponsor_Afadian}"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
<wsc:Setting <clw:SettingsCard
Description="{Binding AppVersion}" Description="{Binding AppVersion}"
Header="{shcm:ResourceString Name=AppName}" Header="{shcm:ResourceString Name=AppName}"
Icon="&#xECAA;"/> HeaderIcon="{shcm:FontIcon Glyph=&#xECAA;}"/>
<wsc:Setting Header="{shcm:ResourceString Name=ViewPageSettingDeviceIdHeader}" Icon="&#xE975;"> <clw:SettingsCard
<wsc:Setting.Description> ActionIcon="{shcm:FontIcon Glyph=&#xE8C8;}"
<TextBlock ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingCopyDeviceIdAction}"
IsTextSelectionEnabled="True" Command="{Binding CopyDeviceIdCommand}"
Style="{StaticResource CaptionTextBlockStyle}" Description="{Binding DeviceId}"
Text="{Binding DeviceId}"/> Header="{shcm:ResourceString Name=ViewPageSettingDeviceIdHeader}"
</wsc:Setting.Description> HeaderIcon="{shcm:FontIcon Glyph=&#xE975;}"
<wsc:Setting.ActionContent> IsClickEnabled="True"/>
<Button Command="{Binding CopyDeviceIdCommand}" Content="{shcm:ResourceString Name=ViewPageSettingCopyDeviceIdAction}"/> <clw:SettingsCard
</wsc:Setting.ActionContent> Description="{Binding WebView2Version}"
</wsc:Setting> Header="{shcm:ResourceString Name=ViewPageSettingWebview2Header}"
<wsc:Setting HeaderIcon="{shcm:FontIcon Glyph=&#xECAA;}"/>
Description="{Binding WebView2Version}"
Header="{shcm:ResourceString Name=ViewPageSettingWebview2Header}"
Icon="&#xECAA;"/>
</wsc:SettingsGroup>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageSettingApperanceHeader}"> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageSettingApperanceHeader}"/>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingApperanceLanguageDescription}" Description="{shcm:ResourceString Name=ViewPageSettingApperanceLanguageDescription}"
Header="{shcm:ResourceString Name=ViewPageSettingApperanceLanguageHeader}" Header="{shcm:ResourceString Name=ViewPageSettingApperanceLanguageHeader}"
Icon="&#xF2B7;"> HeaderIcon="{shcm:FontIcon Glyph=&#xF2B7;}">
<ComboBox <ComboBox
DisplayMemberPath="Name" DisplayMemberPath="Name"
ItemsSource="{Binding Cultures}" ItemsSource="{Binding Cultures}"
SelectedItem="{Binding SelectedCulture, Mode=TwoWay}"/> SelectedItem="{Binding SelectedCulture, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingBackdropMaterialDescription}" Description="{shcm:ResourceString Name=ViewPageSettingBackdropMaterialDescription}"
Header="{shcm:ResourceString Name=ViewPageSettingBackdropMaterialHeader}" Header="{shcm:ResourceString Name=ViewPageSettingBackdropMaterialHeader}"
Icon="&#xE7F7;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE7F7;}">
<ComboBox <ComboBox
DisplayMemberPath="Name" DisplayMemberPath="Name"
ItemsSource="{Binding BackdropTypes}" ItemsSource="{Binding BackdropTypes}"
SelectedItem="{Binding SelectedBackdropType, Mode=TwoWay}"/> SelectedItem="{Binding SelectedBackdropType, Mode=TwoWay}"/>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageSettingGachaLogHeader}"> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageSettingGachaLogHeader}"/>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleDescription}" Description="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleDescription}"
Header="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleHeader}" Header="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleHeader}"
Icon="&#xE81C;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE81C;}">
<ToggleSwitch <ToggleSwitch
IsOn="{Binding Options.IsEmptyHistoryWishVisible, Mode=TwoWay}" IsOn="{Binding Options.IsEmptyHistoryWishVisible, Mode=TwoWay}"
OffContent="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleOff}" OffContent="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleOff}"
OnContent="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleOn}" OnContent="{shcm:ResourceString Name=ViewPageSettingEmptyHistoryVisibleOn}"/>
Style="{StaticResource ToggleSwitchSettingStyle}"/> </clw:SettingsCard>
</wsc:Setting>
</wsc:SettingsGroup>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageSettingGameHeader}"> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageSettingGameHeader}"/>
<InfoBar <InfoBar
IsClosable="False" IsClosable="False"
IsOpen="True" IsOpen="True"
Message="{shcm:ResourceString Name=ViewPageSettingSetGamePathHint}" Message="{shcm:ResourceString Name=ViewPageSettingSetGamePathHint}"
Severity="Informational"/> Severity="Informational"/>
<wsc:Setting <clw:SettingsCard
Description="{Binding Options.GamePath}" ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
Header="{shcm:ResourceString Name=ViewPageSettingSetGamePathHeader}" ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingSetGamePathAction}"
Icon="&#xE7FC;"> Command="{Binding SetGamePathCommand}"
<wsc:Setting.ActionContent> Description="{Binding Options.GamePath}"
<Button Command="{Binding SetGamePathCommand}" Content="{shcm:ResourceString Name=ViewPageSettingSetGamePathAction}"/> Header="{shcm:ResourceString Name=ViewPageSettingSetGamePathHeader}"
</wsc:Setting.ActionContent> HeaderIcon="{shcm:FontIcon Glyph=&#xE7FC;}"
</wsc:Setting> IsClickEnabled="True"/>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingDeleteCacheDescription}" ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
Header="{shcm:ResourceString Name=ViewPageSettingDeleteCacheHeader}" ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingDeleteCacheAction}"
Icon="&#xE74D;"> Command="{Binding DeleteGameWebCacheCommand}"
<wsc:Setting.ActionContent> Description="{shcm:ResourceString Name=ViewPageSettingDeleteCacheDescription}"
<Button Command="{Binding DeleteGameWebCacheCommand}" Content="{shcm:ResourceString Name=ViewPageSettingDeleteCacheAction}"/> Header="{shcm:ResourceString Name=ViewPageSettingDeleteCacheHeader}"
</wsc:Setting.ActionContent> HeaderIcon="{shcm:FontIcon Glyph=&#xE74D;}"
</wsc:Setting> IsClickEnabled="True"/>
</wsc:SettingsGroup>
<wsc:SettingsGroup Header="{shcm:ResourceString Name=ViewPageSettingStorageHeader}"> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageSettingStorageHeader}"/>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingDataFolderDescription}" ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
Header="{shcm:ResourceString Name=ViewPageSettingDataFolderHeader}" ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingStorageOpenAction}"
Icon="&#xEC25;"> Command="{Binding Experimental.OpenDataFolderCommand}"
<wsc:Setting.ActionContent> Description="{shcm:ResourceString Name=ViewPageSettingDataFolderDescription}"
<Button Command="{Binding Experimental.OpenDataFolderCommand}" Content="{shcm:ResourceString Name=ViewPageSettingStorageOpenAction}"/> Header="{shcm:ResourceString Name=ViewPageSettingDataFolderHeader}"
</wsc:Setting.ActionContent> HeaderIcon="{shcm:FontIcon Glyph=&#xEC25;}"
</wsc:Setting> IsClickEnabled="True"/>
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingSetDataFolderDescription}" ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
Header="{shcm:ResourceString Name=ViewPageSettingSetDataFolderHeader}" ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingStorageSetAction}"
Icon="&#xE8DE;"> Command="{Binding SetDataFolderCommand}"
<wsc:Setting.ActionContent> Description="{shcm:ResourceString Name=ViewPageSettingSetDataFolderDescription}"
<Button Command="{Binding SetDataFolderCommand}" Content="{shcm:ResourceString Name=ViewPageSettingStorageSetAction}"/> Header="{shcm:ResourceString Name=ViewPageSettingSetDataFolderHeader}"
</wsc:Setting.ActionContent> HeaderIcon="{shcm:FontIcon Glyph=&#xE8DE;}"
</wsc:Setting> IsClickEnabled="True"/>
<wsc:Setting
Margin="0,4,0,0"
Description="{shcm:ResourceString Name=ViewPageSettingCacheFolderDescription}"
Header="{shcm:ResourceString Name=ViewPageSettingCacheFolderHeader}"
Icon="&#xE8B7;">
<wsc:Setting.ActionContent>
<Button Command="{Binding Experimental.OpenCacheFolderCommand}" Content="{shcm:ResourceString Name=ViewPageSettingStorageOpenAction}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
<wsc:Setting
Description="{shcm:ResourceString Name=ViewPageSettingResetStaticResourceDescription}"
Header="{shcm:ResourceString Name=ViewPageSettingResetStaticResourceHeader}"
Icon="&#xEBC4;">
<wsc:Setting.ActionContent>
<Button Command="{Binding ResetStaticResourceCommand}" Content="{shcm:ResourceString Name=ViewPageSettingResetAction}"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
</wsc:SettingsGroup>
<wsc:SettingsGroup Header="测试功能"> <clw:SettingsCard
<InfoBar Margin="0,4,0,0"
IsClosable="False" ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
IsOpen="True" ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingStorageOpenAction}"
Message="测试功能是尚未完善,仅用于 Pollyfill 的功能,未来可能会存在更合理的位置放置这些功能" Command="{Binding Experimental.OpenCacheFolderCommand}"
Severity="Warning"/> Description="{shcm:ResourceString Name=ViewPageSettingCacheFolderDescription}"
<wsc:Setting Header="{shcm:ResourceString Name=ViewPageSettingCacheFolderHeader}"
Description="对当前选中的账号进行签到" HeaderIcon="{shcm:FontIcon Glyph=&#xE8B7;}"
Header="米游社每日签到" IsClickEnabled="True"/>
Icon="&#xE9D5;"> <clw:SettingsCard
<wsc:Setting.ActionContent> ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
<Button Command="{Binding ShowSignInWebViewDialogCommand}" Content="打开签到对话框"/> ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingResetAction}"
</wsc:Setting.ActionContent> Command="{Binding ResetStaticResourceCommand}"
</wsc:Setting> Description="{shcm:ResourceString Name=ViewPageSettingResetStaticResourceDescription}"
</wsc:SettingsGroup> Header="{shcm:ResourceString Name=ViewPageSettingResetStaticResourceHeader}"
HeaderIcon="{shcm:FontIcon Glyph=&#xEBC4;}"
IsClickEnabled="True"/>
<wsc:SettingsGroup Foreground="{ThemeResource SystemFillColorCriticalBrush}" Header="{shcm:ResourceString Name=ViewPageSettingDangerousHeader}"> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="测试功能"/>
<InfoBar <InfoBar
IsClosable="False" IsClosable="False"
IsOpen="{Binding Options.IsAdvancedLaunchOptionsEnabled}" IsOpen="True"
Message="{shcm:ResourceString Name=ViewPageSettingFeaturesDangerousHint}" Message="测试功能是尚未完善,仅用于 Pollyfill 的功能,未来可能会存在更合理的位置放置这些功能"
Severity="Error"/> Severity="Warning"/>
<InfoBar <clw:SettingsCard
Margin="0,2,0,0" ActionIcon="{shcm:FontIcon Glyph=&#xE76C;}"
IsClosable="False" ActionIconToolTip="打开签到对话框"
IsOpen="{Binding IsElevated, Converter={StaticResource BoolNegationConverter}}" Command="{Binding ShowSignInWebViewDialogCommand}"
Message="{shcm:ResourceString Name=ViewPageLaunchGameElevationHint}" Description="对当前选中的账号进行签到"
Severity="Warning"/> Header="米游社每日签到"
HeaderIcon="{shcm:FontIcon Glyph=&#xE9D5;}"
IsClickEnabled="True"/>
<wsc:Setting <TextBlock
Background="{StaticResource SystemFillColorCriticalBackgroundBrush}" Foreground="{ThemeResource SystemFillColorCriticalBrush}"
Description="{shcm:ResourceString Name=ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
Header="{shcm:ResourceString Name=ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader}" Text="{shcm:ResourceString Name=ViewPageSettingDangerousHeader}"/>
Icon="&#xE730;"> <InfoBar
<wsc:Setting.ActionContent> IsClosable="False"
<ToggleSwitch IsOpen="{Binding Options.IsAdvancedLaunchOptionsEnabled}"
Width="120" Message="{shcm:ResourceString Name=ViewPageSettingFeaturesDangerousHint}"
IsEnabled="{Binding IsElevated}" Severity="Error"/>
IsOn="{Binding Options.IsAdvancedLaunchOptionsEnabled, Mode=TwoWay}" <InfoBar
Style="{StaticResource ToggleSwitchSettingStyle}"/> IsClosable="False"
</wsc:Setting.ActionContent> IsOpen="{Binding IsElevated, Converter={StaticResource BoolNegationConverter}}"
</wsc:Setting> Message="{shcm:ResourceString Name=ViewPageLaunchGameElevationHint}"
Severity="Warning"/>
<InfoBar <clw:SettingsCard
IsClosable="False" Background="{StaticResource SystemFillColorCriticalBackgroundBrush}"
IsOpen="True" BorderBrush="{StaticResource SystemFillColorCriticalBrush}"
Message="{shcm:ResourceString Name=ViewPageSettingDangerousHint}" Description="{shcm:ResourceString Name=ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription}"
Severity="Error"/> Header="{shcm:ResourceString Name=ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader}"
HeaderIcon="{shcm:FontIcon Glyph=&#xE730;}">
<ToggleSwitch
Width="120"
IsEnabled="{Binding IsElevated}"
IsOn="{Binding Options.IsAdvancedLaunchOptionsEnabled, Mode=TwoWay}"/>
</clw:SettingsCard>
<InfoBar
IsClosable="False"
IsOpen="True"
Message="{shcm:ResourceString Name=ViewPageSettingDangerousHint}"
Severity="Error"/>
<wsc:Setting <clw:SettingsCard
Background="{StaticResource SystemFillColorCriticalBackgroundBrush}" ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingDangerousAction}"
Description="{shcm:ResourceString Name=ViewPageSettingDeleteUserDescription}" Command="{Binding Experimental.DeleteUsersCommand}"
Header="{shcm:ResourceString Name=ViewPageSettingDeleteUserHeader}" Description="{shcm:ResourceString Name=ViewPageSettingDeleteUserDescription}"
Icon="&#xE756;"> Header="{shcm:ResourceString Name=ViewPageSettingDeleteUserHeader}"
<wsc:Setting.ActionContent> HeaderIcon="{shcm:FontIcon Glyph=&#xE756;}"
<Button Command="{Binding Experimental.DeleteUsersCommand}" Content="{shcm:ResourceString Name=ViewPageSettingDangerousAction}"/> IsClickEnabled="True"/>
</wsc:Setting.ActionContent>
</wsc:Setting>
</wsc:SettingsGroup>
</StackPanel> </StackPanel>
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.SpiralAbyssRecordPage" x:Class="Snap.Hutao.View.Page.SpiralAbyssRecordPage"
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:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls" xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
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"
@@ -12,7 +13,6 @@
xmlns:shcm="using:Snap.Hutao.Control.Markup" xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shv="using:Snap.Hutao.ViewModel" xmlns:shv="using:Snap.Hutao.ViewModel"
xmlns:shvc="using:Snap.Hutao.View.Control" xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shv:SpiralAbyssRecordViewModel}" d:DataContext="{d:DesignInstance shv:SpiralAbyssRecordViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -60,100 +60,108 @@
<ColumnDefinition MaxWidth="600"/> <ColumnDefinition MaxWidth="600"/>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Margin="16,0,8,16"> <StackPanel
<wsc:SettingsGroup Margin="0,-48,16,0"> Grid.Column="0"
<wsc:Setting Content="{Binding TotalBattleTimes}" Header="{shcm:ResourceString Name=ViewSpiralAbyssBattleTimes}"/> Margin="16,0,8,16"
<wsc:Setting Content="{Binding TotalStar}" Header="{shcm:ResourceString Name=ViewSpiralAbyssTotalStar}"/> Spacing="{StaticResource SettingsCardSpacing}">
<wsc:Setting Content="{Binding MaxFloor}" Header="{shcm:ResourceString Name=ViewSpiralAbyssMaxFloor}"/> <StackPanel.Resources>
</wsc:SettingsGroup> <x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
<wsc:SettingsGroup Margin="0,0,16,0" Header="{shcm:ResourceString Name=ViewSpiralAbyssReveal}"> <x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
<ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding Reveals}"> <x:Double x:Key="SettingsCardMinHeight">0</x:Double>
<ItemsControl.ItemsPanel> </StackPanel.Resources>
<ItemsPanelTemplate> <clw:SettingsCard
<cwuc:UniformGrid ColumnSpacing="16" Columns="4"/> Margin="0,16,0,0"
</ItemsPanelTemplate> Content="{Binding TotalBattleTimes}"
</ItemsControl.ItemsPanel> Header="{shcm:ResourceString Name=ViewSpiralAbyssBattleTimes}"/>
<ItemsControl.ItemTemplate> <clw:SettingsCard Content="{Binding TotalStar}" Header="{shcm:ResourceString Name=ViewSpiralAbyssTotalStar}"/>
<DataTemplate> <clw:SettingsCard Content="{Binding MaxFloor}" Header="{shcm:ResourceString Name=ViewSpiralAbyssMaxFloor}"/>
<shvc:BottomTextControl Text="{Binding Value}">
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
</shvc:BottomTextControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</wsc:SettingsGroup> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewSpiralAbyssReveal}"/>
<wsc:SettingsGroup Margin="0,0,16,0" Header="{shcm:ResourceString Name=ViewSpiralAbyssBattleHeader}"> <ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding Reveals}">
<wsc:Setting Header="{shcm:ResourceString Name=ViewSpiralAbyssDefeat}"> <ItemsControl.ItemsPanel>
<StackPanel Orientation="Horizontal"> <ItemsPanelTemplate>
<TextBlock <cwuc:UniformGrid ColumnSpacing="16" Columns="4"/>
Margin="0,0,16,0" </ItemsPanelTemplate>
VerticalAlignment="Center" </ItemsControl.ItemsPanel>
Text="{Binding Defeat.Value}"/> <ItemsControl.ItemTemplate>
<shci:CachedImage <DataTemplate>
Width="48" <shvc:BottomTextControl Text="{Binding Value}">
Height="48" <shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
Margin="-8,-24,-8,-8" </shvc:BottomTextControl>
Source="{Binding Defeat.SideIcon}"/> </DataTemplate>
</StackPanel> </ItemsControl.ItemTemplate>
</wsc:Setting> </ItemsControl>
<wsc:Setting Header="{shcm:ResourceString Name=ViewSpiralAbyssDamage}"> <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewSpiralAbyssBattleHeader}"/>
<StackPanel Orientation="Horizontal"> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewSpiralAbyssDefeat}">
<TextBlock <StackPanel Orientation="Horizontal">
Margin="0,0,16,0" <TextBlock
VerticalAlignment="Center" Margin="0,0,16,0"
Text="{Binding Damage.Value}"/> VerticalAlignment="Center"
<shci:CachedImage Text="{Binding Defeat.Value}"/>
Width="48" <shci:CachedImage
Height="48" Width="48"
Margin="-8,-24,-8,-8" Height="48"
Source="{Binding Damage.SideIcon}"/> Margin="-8,-24,-8,-8"
</StackPanel> Source="{Binding Defeat.SideIcon}"/>
</wsc:Setting> </StackPanel>
</clw:SettingsCard>
<wsc:Setting Header="{shcm:ResourceString Name=ViewSpiralAbyssTakeDamage}"> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewSpiralAbyssDamage}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="0,0,16,0" Margin="0,0,16,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding TakeDamage.Value}"/> Text="{Binding Damage.Value}"/>
<shci:CachedImage <shci:CachedImage
Width="48" Width="48"
Height="48" Height="48"
Margin="-8,-24,-8,-8" Margin="-8,-24,-8,-8"
Source="{Binding TakeDamage.SideIcon}"/> Source="{Binding Damage.SideIcon}"/>
</StackPanel> </StackPanel>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Header="{shcm:ResourceString Name=ViewSpiralAbyssNormalSkill}"> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewSpiralAbyssTakeDamage}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="0,0,16,0" Margin="0,0,16,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding NormalSkill.Value}"/> Text="{Binding TakeDamage.Value}"/>
<shci:CachedImage <shci:CachedImage
Width="48" Width="48"
Height="48" Height="48"
Margin="-8,-24,-8,-8" Margin="-8,-24,-8,-8"
Source="{Binding NormalSkill.SideIcon}"/> Source="{Binding TakeDamage.SideIcon}"/>
</StackPanel> </StackPanel>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Header="{shcm:ResourceString Name=ViewSpiralAbyssEnergySkill}"> <clw:SettingsCard Header="{shcm:ResourceString Name=ViewSpiralAbyssNormalSkill}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="0,0,16,0" Margin="0,0,16,0"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding EnergySkill.Value}"/> Text="{Binding NormalSkill.Value}"/>
<shci:CachedImage <shci:CachedImage
Width="48" Width="48"
Height="48" Height="48"
Margin="-8,-24,-8,-8" Margin="-8,-24,-8,-8"
Source="{Binding EnergySkill.SideIcon}"/> Source="{Binding NormalSkill.SideIcon}"/>
</StackPanel> </StackPanel>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup>
<clw:SettingsCard Header="{shcm:ResourceString Name=ViewSpiralAbyssEnergySkill}">
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="0,0,16,0"
VerticalAlignment="Center"
Text="{Binding EnergySkill.Value}"/>
<shci:CachedImage
Width="48"
Height="48"
Margin="-8,-24,-8,-8"
Source="{Binding EnergySkill.SideIcon}"/>
</StackPanel>
</clw:SettingsCard>
</StackPanel> </StackPanel>
</Grid> </Grid>
@@ -297,14 +305,14 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource SubtitleTextBlockStyle}" Style="{StaticResource SubtitleTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewSpiralAbyssDefaultDescription}"/> Text="{shcm:ResourceString Name=ViewSpiralAbyssDefaultDescription}"/>
<wsc:SettingsGroup Margin="0,-36,0,0" HorizontalAlignment="Center"> <StackPanel Margin="0,-36,0,0" HorizontalAlignment="Center">
<wsc:Setting <clw:SettingsCard
Description="{shcm:ResourceString Name=ViewSpiralAbyssRefreshDescription}" Description="{shcm:ResourceString Name=ViewSpiralAbyssRefreshDescription}"
Header="{shcm:ResourceString Name=ViewSpiralAbyssRefresh}" Header="{shcm:ResourceString Name=ViewSpiralAbyssRefresh}"
Icon="&#xE72c;"> HeaderIcon="{shcm:FontIcon Glyph=&#xE72c;}">
<Button Command="{Binding RefreshCommand}" Content="{shcm:ResourceString Name=ViewSpiralAbyssRefreshAction}"/> <Button Command="{Binding RefreshCommand}" Content="{shcm:ResourceString Name=ViewSpiralAbyssRefreshAction}"/>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup> </StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Grid> </Grid>

View File

@@ -2,11 +2,11 @@
x:Class="Snap.Hutao.View.Page.TestPage" x:Class="Snap.Hutao.View.Page.TestPage"
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:clw="using:CommunityToolkit.Labs.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"
xmlns:shc="using:Snap.Hutao.Control" xmlns:shc="using:Snap.Hutao.Control"
xmlns:shv="using:Snap.Hutao.ViewModel" xmlns:shv="using:Snap.Hutao.ViewModel"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance shv:TestViewModel}" d:DataContext="{d:DesignInstance shv:TestViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -16,24 +16,24 @@
</Style> </Style>
</Page.Resources> </Page.Resources>
<ScrollViewer> <ScrollViewer>
<wsc:SettingsGroup Margin="16,0,16,16" Header="This page is only for the test purpose."> <StackPanel Margin="16">
<wsc:Setting Header="DangerousLoginMihoyoBbsTest"> <clw:SettingsCard Header="DangerousLoginMihoyoBbsTest">
<Button Command="{Binding DangerousLoginMihoyoBbsCommand}" Content="Login"/> <Button Command="{Binding DangerousLoginMihoyoBbsCommand}" Content="Login"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Header="CommunityGameRecordDialogTest"> <clw:SettingsCard Header="CommunityGameRecordDialogTest">
<Button Command="{Binding ShowCommunityGameRecordDialogCommand}" Content="Open"/> <Button Command="{Binding ShowCommunityGameRecordDialogCommand}" Content="Open"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Header="AdoptCalculatorDialogTest"> <clw:SettingsCard Header="AdoptCalculatorDialogTest">
<Button Command="{Binding ShowAdoptCalculatorDialogCommand}" Content="Open"/> <Button Command="{Binding ShowAdoptCalculatorDialogCommand}" Content="Open"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Header="DownloadStaticFileTest"> <clw:SettingsCard Header="DownloadStaticFileTest">
<Button Command="{Binding DownloadStaticFileCommand}" Content="Download"/> <Button Command="{Binding DownloadStaticFileCommand}" Content="Download"/>
</wsc:Setting> </clw:SettingsCard>
<wsc:Setting Header="RestartTest"> <clw:SettingsCard Header="RestartTest">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ToggleSwitch Name="ElevatedSwitch" Style="{StaticResource DefaultToggleSwitchStyle}"/> <ToggleSwitch Name="ElevatedSwitch" Style="{StaticResource DefaultToggleSwitchStyle}"/>
<Button <Button
@@ -41,7 +41,7 @@
CommandParameter="{Binding ElementName=ElevatedSwitch, Path=IsOn}" CommandParameter="{Binding ElementName=ElevatedSwitch, Path=IsOn}"
Content="Restart"/> Content="Restart"/>
</StackPanel> </StackPanel>
</wsc:Setting> </clw:SettingsCard>
</wsc:SettingsGroup> </StackPanel>
</ScrollViewer> </ScrollViewer>
</shc:ScopedPage> </shc:ScopedPage>

View File

@@ -472,32 +472,31 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Column="0" Grid.Column="0"
Margin="16,16,0,0"
Style="{StaticResource BaseTextBlockStyle}" Style="{StaticResource BaseTextBlockStyle}"
Text="特殊料理"/> Text="特殊料理"/>
<shvc:BottomTextControl <shvc:BottomTextControl
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="16,16,0,16" Margin="0,16,0,0"
Text="{Binding Item.Name}"> Text="{Binding Item.Name}">
<shvc:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/> <shvc:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
</shvc:BottomTextControl> </shvc:BottomTextControl>
<TextBlock <TextBlock
Grid.Column="1" Grid.Column="1"
Margin="16,16,0,0" Margin="16,0,0,0"
Style="{StaticResource BaseTextBlockStyle}" Style="{StaticResource BaseTextBlockStyle}"
Text="原料理"/> Text="原料理"/>
<shvc:BottomTextControl <shvc:BottomTextControl
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="16,16,0,16" Margin="16,16,0,0"
Text="{Binding OriginItem.Name}"> Text="{Binding OriginItem.Name}">
<shvc:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/> <shvc:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
</shvc:BottomTextControl> </shvc:BottomTextControl>
<StackPanel <StackPanel
Grid.RowSpan="4" Grid.RowSpan="4"
Grid.Column="2" Grid.Column="2"
Margin="16"> Margin="16,0,0,0">
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.ColumnSpan="4" Grid.ColumnSpan="4"
@@ -519,10 +518,10 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
Header="衣装"> Header="衣装">
<ItemsControl Margin="0,16,0,0" ItemsSource="{Binding Selected.Costumes}"> <ItemsControl Margin="0,0,0,-16" ItemsSource="{Binding Selected.Costumes}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid> <Grid Margin="0,0,0,16">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
<ColumnDefinition/> <ColumnDefinition/>
@@ -530,12 +529,12 @@
<shci:CachedImage <shci:CachedImage
Width="80" Width="80"
Height="80" Height="80"
Margin="16,0,16,16" Margin="0,0,16,0"
Source="{StaticResource UI_AvatarIcon_Costume_Card}"/> Source="{StaticResource UI_AvatarIcon_Costume_Card}"/>
<shci:CachedImage <shci:CachedImage
Width="80" Width="80"
Height="80" Height="80"
Margin="16,0,16,16" Margin="0,0,16,0"
Source="{Binding Icon, Converter={StaticResource AvatarCardConverter}}"/> Source="{Binding Icon, Converter={StaticResource AvatarCardConverter}}"/>
<StackPanel Grid.Column="1" Margin="0,0,16,-4"> <StackPanel Grid.Column="1" Margin="0,0,16,-4">
<TextBlock Text="{Binding Name}"/> <TextBlock Text="{Binding Name}"/>
@@ -558,14 +557,14 @@
<ItemsControl ItemsSource="{Binding Selected.FetterInfo.Fetters}"> <ItemsControl ItemsSource="{Binding Selected.FetterInfo.Fetters}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Margin="0,0,0,-4"> <StackPanel Margin="0,0,0,0">
<TextBlock Margin="16,16,16,0" Text="{Binding Title}"/> <TextBlock Text="{Binding Title}"/>
<shct:DescriptionTextBlock Margin="16,8,16,16" Description="{Binding Context}"> <shct:DescriptionTextBlock Margin="0,8,0,0" Description="{Binding Context}">
<shct:DescriptionTextBlock.Resources> <shct:DescriptionTextBlock.Resources>
<Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock"/> <Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock"/>
</shct:DescriptionTextBlock.Resources> </shct:DescriptionTextBlock.Resources>
</shct:DescriptionTextBlock> </shct:DescriptionTextBlock>
<MenuFlyoutSeparator Margin="16,0"/> <MenuFlyoutSeparator Margin="0,8"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
@@ -580,13 +579,13 @@
<ItemsControl ItemsSource="{Binding Selected.FetterInfo.FetterStories}"> <ItemsControl ItemsSource="{Binding Selected.FetterInfo.FetterStories}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Margin="0,0,0,-4"> <StackPanel Margin="0,0,0,0">
<TextBlock Margin="16,16,16,0" Text="{Binding Title}"/> <TextBlock Text="{Binding Title}"/>
<TextBlock <TextBlock
Margin="16,8,16,16" Margin="0,8,0,0"
Style="{StaticResource CaptionTextBlockStyle}" Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Context}"/> Text="{Binding Context}"/>
<MenuFlyoutSeparator Margin="16,0"/> <MenuFlyoutSeparator Margin="0,8"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.WikiMonsterPage" x:Class="Snap.Hutao.View.Page.WikiMonsterPage"
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:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls" xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
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"
@@ -14,7 +15,6 @@
xmlns:shcp="using:Snap.Hutao.Control.Panel" xmlns:shcp="using:Snap.Hutao.Control.Panel"
xmlns:shvc="using:Snap.Hutao.View.Control" xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvw="using:Snap.Hutao.ViewModel.Wiki" xmlns:shvw="using:Snap.Hutao.ViewModel.Wiki"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance Type=shvw:WikiMonsterViewModel}" d:DataContext="{d:DesignInstance Type=shvw:WikiMonsterViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d"> mc:Ignorable="d">
@@ -159,6 +159,11 @@
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}" BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"
IsPromoteVisible="False"/> IsPromoteVisible="False"/>
<ItemsControl Margin="16,16,0,0" ItemsSource="{Binding Selected.BaseValue.SubHurts}"> <ItemsControl Margin="16,16,0,0" ItemsSource="{Binding Selected.BaseValue.SubHurts}">
<ItemsControl.Resources>
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
<x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
</ItemsControl.Resources>
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<cwuc:UniformGrid <cwuc:UniformGrid
@@ -169,9 +174,9 @@
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<wsc:Setting Header="{Binding Name}"> <clw:SettingsCard Header="{Binding Name}">
<TextBlock Text="{Binding Value}"/> <TextBlock Text="{Binding Value}"/>
</wsc:Setting> </clw:SettingsCard>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>

View File

@@ -3,8 +3,6 @@
using CommunityToolkit.WinUI.UI; using CommunityToolkit.WinUI.UI;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using BindingAchievement = Snap.Hutao.ViewModel.Achievement.AchievementView;
using BindingAchievementGoal = Snap.Hutao.ViewModel.Achievement.AchievementGoalView;
namespace Snap.Hutao.ViewModel.Achievement; namespace Snap.Hutao.ViewModel.Achievement;
@@ -35,10 +33,10 @@ internal sealed class AchievementFinishPercentUpdater
if (viewModel.Achievements is AdvancedCollectionView achievements) if (viewModel.Achievements is AdvancedCollectionView achievements)
{ {
if (viewModel.AchievementGoals is List<BindingAchievementGoal> achievementGoals) if (viewModel.AchievementGoals is List<AchievementGoalView> achievementGoals)
{ {
Dictionary<int, AchievementGoalStatistics> counter = achievementGoals.ToDictionary(x => x.Id, x => new AchievementGoalStatistics(x)); Dictionary<int, AchievementGoalStatistics> counter = achievementGoals.ToDictionary(x => x.Id, x => new AchievementGoalStatistics(x));
foreach (BindingAchievement achievement in achievements.SourceCollection.Cast<BindingAchievement>()) foreach (AchievementView achievement in achievements.SourceCollection.Cast<AchievementView>())
{ {
// We want to make the state update as fast as possible, // We want to make the state update as fast as possible,
// so we use CollectionsMarshal here to get the ref. // so we use CollectionsMarshal here to get the ref.