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.MergedDictionaries>
<muxc:XamlControlsResources/>
<ResourceDictionary Source="ms-appx:///SettingsUI/Themes/Generic.xaml"/>
<ResourceDictionary Source="Control/Theme/FontStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
@@ -48,6 +47,17 @@
<GridLength x:Key="CompatGridLength2">268</GridLength>
<!-- Brushes -->
<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 -->
<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>

View File

@@ -1,10 +1,7 @@
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
<!-- Licensed under the MIT License. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<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>
@@ -84,6 +81,13 @@
<Setter Property="OpticalMarginAlignment" Value="TrimSideBearings"/>
</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">
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
</Style>
@@ -99,112 +103,4 @@
<Style TargetType="InfoBar">
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
</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>

View File

@@ -2,7 +2,7 @@
"profiles": {
"Snap.Hutao (Package)": {
"commandName": "MsixPackage",
"nativeDebugging": false,
"nativeDebugging": true,
"doNotLaunchApp": false,
"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>
@@ -3850,7 +3859,7 @@ namespace Snap.Hutao.Resource.Localization {
}
/// <summary>
/// 查找类似 账号 的本地化字符串。
/// 查找类似 检测账号 的本地化字符串。
/// </summary>
internal static string ViewPageLaunchGameSwitchAccountHeader {
get {
@@ -4201,25 +4210,7 @@ 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>
internal static string ViewPageSettingFeaturesDangerousHint {
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>

View File

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

View File

@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.18362.0</TargetFramework>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<RootNamespace>Snap.Hutao</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platform>x64</Platform>
@@ -227,12 +227,13 @@
<!-- Packages -->
<ItemGroup>
<PackageReference Include="CommunityToolkit.Labs.WinUI.SettingsControls" Version="0.0.17" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="CommunityToolkit.WinUI.Notifications" 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="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
@@ -249,13 +250,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<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">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="WinUICommunity.SettingsUI" Version="3.0.4" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,6 +2,7 @@
x:Class="Snap.Hutao.View.Page.WikiMonsterPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:clw="using:CommunityToolkit.Labs.WinUI"
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -14,7 +15,6 @@
xmlns:shcp="using:Snap.Hutao.Control.Panel"
xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvw="using:Snap.Hutao.ViewModel.Wiki"
xmlns:wsc="using:WinUICommunity.SettingsUI.Controls"
d:DataContext="{d:DesignInstance Type=shvw:WikiMonsterViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
@@ -159,6 +159,11 @@
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"
IsPromoteVisible="False"/>
<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>
<ItemsPanelTemplate>
<cwuc:UniformGrid
@@ -169,9 +174,9 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<wsc:Setting Header="{Binding Name}">
<clw:SettingsCard Header="{Binding Name}">
<TextBlock Text="{Binding Value}"/>
</wsc:Setting>
</clw:SettingsCard>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

View File

@@ -3,8 +3,6 @@
using CommunityToolkit.WinUI.UI;
using System.Runtime.InteropServices;
using BindingAchievement = Snap.Hutao.ViewModel.Achievement.AchievementView;
using BindingAchievementGoal = Snap.Hutao.ViewModel.Achievement.AchievementGoalView;
namespace Snap.Hutao.ViewModel.Achievement;
@@ -35,10 +33,10 @@ internal sealed class AchievementFinishPercentUpdater
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));
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,
// so we use CollectionsMarshal here to get the ref.