🚑 fix Settings

This commit is contained in:
Aigio Liu
2023-05-22 19:07:39 +08:00
parent 30ed72f409
commit 775ca499fa
17 changed files with 868 additions and 1002 deletions
+3 -5
View File
@@ -1,6 +1,4 @@
// ReSharper disable once CheckNamespace
using BD.Common.UI.Helpers;
namespace BD.WTTS;
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)]
@@ -40,7 +38,7 @@ partial class Program
[MethodImpl(MethodImplOptions.NoInlining)]
public static AppBuilder BuildAvaloniaApp()
{
UIFrameworkHelper.Init(isAvaloniaUI: true);
Common.UI.Helpers.UIFrameworkHelper.Init(isAvaloniaUI: true);
if (instance == null)
{
@@ -89,7 +87,7 @@ partial class Program
},
});
var useGpu = !IApplication.DisableGPU && GeneralSettings.UseGPURendering.Value;
var useGpu = !IApplication.DisableGPU && GeneralSettings.GPU.Value;
#if MACOS
builder.With(new AvaloniaNativePlatformOptions
{
@@ -104,7 +102,7 @@ partial class Program
EnableIme = true,
});
#elif WINDOWS
var useWgl = IApplication.UseWgl || GeneralSettings.UseWgl.Value;
var useWgl = IApplication.UseWgl || GeneralSettings.NativeOpenGL.Value;
var options = new Win32PlatformOptions
{
UseWgl = useWgl,
@@ -2,6 +2,23 @@ namespace BD.WTTS.Converters;
public sealed class NameToFontFamilyConverter : IValueConverter
{
static FontFamily GetDefault()
{
try
{
var fontFamily = IPlatformService.Instance.GetDefaultFontFamily();
return FontFamily.Parse(fontFamily);
}
catch
{
}
return FontFamily.Default;
}
static readonly Lazy<FontFamily> _FontFamily = new(GetDefault);
public static FontFamily DefaultFontFamily => _FontFamily.Value;
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is string s)
@@ -10,9 +27,16 @@ public sealed class NameToFontFamilyConverter : IValueConverter
// return AvaloniaFontManagerImpl.Default;
//if (s.Equals(IFontManager.KEY_DefaultConsole, StringComparison.OrdinalIgnoreCase))
// return AvaloniaFontManagerImpl.DefaultConsole;
return FontFamily.Parse(s);
try
{
return FontFamily.Parse(s);
}
catch
{
}
}
return null;
return DefaultFontFamily;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -20,7 +20,7 @@ partial class App
var s = Startup.Instance;
if (s.IsMainProcess)
{
s.HasTrayIcon = GeneralSettings.IsEnableTrayIcon.Value;
s.HasTrayIcon = GeneralSettings.TrayIcon.Value;
if (s.HasTrayIcon)
{
TrayIcon.SetIcons(this, TrayIcons);
+7 -7
View File
@@ -55,8 +55,8 @@ public sealed partial class App : Application
{
desktop.MainWindow = MainWindow ??= new MainWindow();
}
SetThemeNotChangeValue((AppTheme)UISettings.Theme.Value);
SetThemeAccent(UISettings.GetUserThemeAccent.Value ? bool.TrueString : UISettings.ThemeAccent.Value);
SetThemeNotChangeValue(UISettings.Theme.Value);
SetThemeAccent(UISettings.UseSystemThemeAccent.Value ? bool.TrueString : UISettings.ThemeAccent.Value);
base.OnFrameworkInitializationCompleted();
}
@@ -85,7 +85,7 @@ public sealed partial class App : Application
/// 设置当前打开窗口的 AvaloniaWindow 背景透明材质
/// </summary>
/// <param name="level"></param>
public void SetAllWindowransparencyMateria(int level)
public void SetAllWindowransparencyMateria(WindowBackgroundMaterial level)
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
@@ -121,14 +121,14 @@ public sealed partial class App : Application
public void InitSettingSubscribe()
{
GeneralSettings.IsEnableTrayIcon.Subscribe(x => InitTrayIcon());
GeneralSettings.TrayIcon.Subscribe(x => InitTrayIcon());
UISettings.ThemeAccent.Subscribe(SetThemeAccent);
UISettings.GetUserThemeAccent.Subscribe(x =>
UISettings.UseSystemThemeAccent.Subscribe(x =>
SetThemeAccent(x ? bool.TrueString : UISettings.ThemeAccent.Value));
GeneralSettings.WindowsStartupAutoRun.Subscribe(IApplication.SetBootAutoStart);
GeneralSettings.AutoRunOnStartup.Subscribe(IApplication.SetBootAutoStart);
UISettings.WindowBackgroundMateria.Subscribe(SetAllWindowransparencyMateria, false);
UISettings.WindowBackgroundMaterial.Subscribe(SetAllWindowransparencyMateria, false);
//#if WINDOWS
// UISettings.EnableDesktopBackground.Subscribe(x =>
@@ -1,284 +1,306 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ms="https://steampp.net/settings"
xmlns:spp="https://steampp.net/ui"
xmlns:ms="https://steampp.net/settings"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:wnd="using:FluentAvalonia.UI.Windowing">
<Design.PreviewWith>
<spp:MinMaxCloseControl>
<!-- Add Controls for Previewer Here -->
</spp:MinMaxCloseControl>
</Design.PreviewWith>
<Design.PreviewWith>
<spp:MinMaxCloseControl>
<!-- Add Controls for Previewer Here -->
</spp:MinMaxCloseControl>
</Design.PreviewWith>
<!-- Add Resources Here -->
<ControlTheme x:Key="FA_SystemCaptionButton" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource FATitle_SysCaptionBackground}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Width" Value="36" />
<Setter Property="Height" Value="36" />
<Setter Property="Foreground" Value="{DynamicResource FATitle_SysCaptionForeground}" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}">
<Viewbox Width="14" Height="14">
<ui:FontIcon
<!-- Add Resources Here -->
<ControlTheme x:Key="FA_SystemCaptionButton" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource FATitle_SysCaptionBackground}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Width" Value="36" />
<Setter Property="Height" Value="36" />
<Setter Property="Foreground" Value="{DynamicResource FATitle_SysCaptionForeground}" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="FontFamily" Value="{StaticResource SymbolThemeFontFamily}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}">
<Viewbox Width="14" Height="14">
<ui:FontIcon
Name="ButtonIcon"
FontFamily="{StaticResource SymbolThemeFontFamily}"
Glyph="{TemplateBinding Content}" />
</Viewbox>
</Border>
</ControlTemplate>
</Setter>
</Viewbox>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:inactive">
<Style Selector="^ /template/ Border">
<Setter Property="Background" Value="{DynamicResource FATitle_SysCaptionBackgroundInactive}" />
</Style>
<Style Selector="^ /template/ ui|FontIcon">
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
</Style>
</Style>
<Style Selector="^:inactive">
<Style Selector="^ /template/ Border">
<Setter Property="Background" Value="{DynamicResource FATitle_SysCaptionBackgroundInactive}" />
</Style>
<Style Selector="^ /template/ ui|FontIcon">
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
</Style>
</Style>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
</Style>
<Style Selector="^ /template/ ui|FontIcon">
<Setter Property="Foreground" Value="{DynamicResource FATitle_SysCaptionForeground}" />
</Style>
</Style>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
</Style>
<Style Selector="^ /template/ ui|FontIcon">
<Setter Property="Foreground" Value="{DynamicResource FATitle_SysCaptionForeground}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ Border">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" />
</Style>
<Style Selector="^ /template/ ui|FontIcon">
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPressed}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ Border">
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" />
</Style>
<Style Selector="^ /template/ ui|FontIcon">
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPressed}" />
</Style>
</Style>
<Style Selector="^.Close">
<Style Selector="^:pointerover /template/ Border">
<Setter Property="Background" Value="#e81123" />
</Style>
<Style Selector="^:pointerover /template/ ui|FontIcon">
<Setter Property="Foreground" Value="White" />
</Style>
<Style Selector="^:pressed /template/ Border">
<Setter Property="Background" Value="#f1707a" />
</Style>
<Style Selector="^:pressed /template/ ui|FontIcon">
<Setter Property="Foreground" Value="White" />
</Style>
</Style>
<Style Selector="^.Close">
<Style Selector="^:pointerover /template/ Border">
<Setter Property="Background" Value="#e81123" />
</Style>
<Style Selector="^:pointerover /template/ ui|FontIcon">
<Setter Property="Foreground" Value="White" />
</Style>
<Style Selector="^:pressed /template/ Border">
<Setter Property="Background" Value="#f1707a" />
</Style>
<Style Selector="^:pressed /template/ ui|FontIcon">
<Setter Property="Foreground" Value="White" />
</Style>
</Style>
<Style Selector="^:disabled">
<Setter Property="Opacity" Value="0.5" />
</Style>
</ControlTheme>
<Style Selector="^:disabled">
<Setter Property="Opacity" Value="0.5" />
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type wnd:MinMaxCloseControl}" TargetType="wnd:MinMaxCloseControl">
<Setter Property="Template">
<ControlTemplate>
<StackPanel
Orientation="Horizontal"
Spacing="8">
<Button
<ControlTheme x:Key="{x:Type wnd:MinMaxCloseControl}" TargetType="wnd:MinMaxCloseControl">
<Setter Property="Template">
<ControlTemplate>
<StackPanel Orientation="Horizontal" Spacing="8">
<Button
Name="MinimizeButton"
Content="&#xE921;"
Theme="{StaticResource FA_SystemCaptionButton}" />
<Button
<Button
Name="MaxRestoreButton"
Content="&#xE922;"
Theme="{StaticResource FA_SystemCaptionButton}" />
<Button
<Button
Name="CloseButton"
Classes="Close"
Content="&#xE8BB;"
Theme="{StaticResource FA_SystemCaptionButton}" />
</StackPanel>
</ControlTemplate>
</Setter>
</StackPanel>
</ControlTemplate>
</Setter>
<Style Selector="^:maximized /template/ Button#MaxRestoreButton">
<Setter Property="Content" Value="&#xE923;" />
</Style>
</ControlTheme>
<Style Selector="^:maximized /template/ Button#MaxRestoreButton">
<Setter Property="Content" Value="&#xE923;" />
</Style>
</ControlTheme>
<ControlTheme TargetType="wnd:AppSplashScreen" x:Key="{x:Type wnd:AppSplashScreen}">
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
<Setter Property="Foreground" Value="{DynamicResource CoreSplashScreenForeground}" />
<Setter Property="Template">
<ControlTemplate>
<Panel Name="Root"
Background="{TemplateBinding Background}">
<TextBlock Name="AppNameText"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontSize="{DynamicResource SplashScreenTextSize}"
FontWeight="{DynamicResource SplashScreenTextFontWeight}"/>
<Image Name="AppImageHost"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Width="{DynamicResource SplashScreenImageWidth}"
Height="{DynamicResource SplashScreenImageWidth}" />
<ContentPresenter Name="ContentHost"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch" />
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type wnd:AppSplashScreen}" TargetType="wnd:AppSplashScreen">
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
<Setter Property="Foreground" Value="{DynamicResource CoreSplashScreenForeground}" />
<Setter Property="Template">
<ControlTemplate>
<Panel Name="Root" Background="{TemplateBinding Background}">
<TextBlock
Name="AppNameText"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="{DynamicResource SplashScreenTextSize}"
FontWeight="{DynamicResource SplashScreenTextFontWeight}" />
<Image
Name="AppImageHost"
Width="{DynamicResource SplashScreenImageWidth}"
Height="{DynamicResource SplashScreenImageWidth}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<ContentPresenter
Name="ContentHost"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch" />
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTemplate x:Key="AppWindowOnWindowsTemplate" TargetType="{x:Type wnd:AppWindow}">
<VisualLayerManager>
<!-- Because we use the System Border, we don't specify anything like that here.-->
<Border Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
Name="RootBorder">
<Panel>
<Panel Name="WindowBackground">
<Border Background="{DynamicResource SolidBackgroundFillColorBaseBrush}"
Opacity="{ReflectionBinding Value,Source={x:Static ms:UISettings.AcrylicOpacity},Mode=OneWay}">
</Border>
<Image Source="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImagePath},Path=Value, Mode=OneWay,Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImageStretch},Path=Value, Mode=OneWay}"
Opacity="{ReflectionBinding Value,Source={x:Static ms:UISettings.BackgroundImageOpacity},Mode=OneWay}"
IsVisible="{ReflectionBinding Source={x:Static ms:UISettings.EnableCustomBackgroundImage},Path=Value, Mode=OneWay}"/>
</Panel>
<Panel Name="DefaultTitleBar"
Height="{Binding TemplateSettings.TitleBarHeight, RelativeSource={RelativeSource TemplatedParent}}"
Background="{DynamicResource FATitle_TitleBarBackground}"
TextElement.Foreground="{DynamicResource FATitle_TitleBarForeground}"
VerticalAlignment="Top">
<ControlTemplate x:Key="AppWindowOnWindowsTemplate" TargetType="{x:Type wnd:AppWindow}">
<VisualLayerManager>
<!-- Because we use the System Border, we don't specify anything like that here. -->
<Border
Name="RootBorder"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}">
<Panel>
<Panel Name="WindowBackground">
<Border Background="{DynamicResource SolidBackgroundFillColorBaseBrush}" Opacity="{ReflectionBinding Value, Source={x:Static ms:UISettings.WindowBackgroundMaterial}, Mode=OneWay}" />
<Image
IsVisible="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImage},
Path=Value,
Mode=OneWay}"
Opacity="{ReflectionBinding Value,
Source={x:Static ms:UISettings.WindowBackgroundCustomImageOpacity},
Mode=OneWay}"
Source="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImagePath},
Path=Value,
Mode=OneWay,
Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImageStretch},
Path=Value,
Mode=OneWay}" />
</Panel>
<Panel
Name="DefaultTitleBar"
Height="{Binding TemplateSettings.TitleBarHeight, RelativeSource={RelativeSource TemplatedParent}}"
VerticalAlignment="Top"
Background="{DynamicResource FATitle_TitleBarBackground}"
TextElement.Foreground="{DynamicResource FATitle_TitleBarForeground}">
<Image Source="{TemplateBinding Icon}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Width="16" Height="16"
IsVisible="{Binding TemplateSettings.IsTitleBarContentVisible, RelativeSource={RelativeSource TemplatedParent}}"
Margin="8 0 0 0"
Name="Icon"/>
<Image
Name="Icon"
Width="16"
Height="16"
Margin="8,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsVisible="{Binding TemplateSettings.IsTitleBarContentVisible, RelativeSource={RelativeSource TemplatedParent}}"
Source="{TemplateBinding Icon}" />
<TextBlock Name="TitleText"
Text="{TemplateBinding Title}"
Margin="12 0 0 0"
FontSize="12"
IsVisible="{Binding TemplateSettings.IsTitleBarContentVisible, RelativeSource={RelativeSource TemplatedParent}}"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
</Panel>
<TextBlock
Name="TitleText"
Margin="12,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="12"
IsVisible="{Binding TemplateSettings.IsTitleBarContentVisible, RelativeSource={RelativeSource TemplatedParent}}"
Text="{TemplateBinding Title}" />
</Panel>
<ContentPresenter Name="PART_ContentPresenter"
ClipToBounds="False"
Margin="{Binding TemplateSettings.ContentMargin, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<ContentPresenter
Name="PART_ContentPresenter"
Margin="{Binding TemplateSettings.ContentMargin, RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ClipToBounds="False"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<wnd:AppSplashScreen Name="SplashHost"
IsVisible="False"/>
<wnd:AppSplashScreen Name="SplashHost" IsVisible="False" />
<!-- Add the Caption Buttons, these should ALWAYS overlay the window -->
<wnd:MinMaxCloseControl HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="18,0"
Name="SystemCaptionButtons"
Height="{Binding TemplateSettings.TitleBarHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
<!-- Add the Caption Buttons, these should ALWAYS overlay the window -->
<wnd:MinMaxCloseControl
Name="SystemCaptionButtons"
Height="{Binding TemplateSettings.TitleBarHeight, RelativeSource={RelativeSource TemplatedParent}}"
Margin="18,0"
HorizontalAlignment="Right"
VerticalAlignment="Top" />
</Panel>
</Border>
</VisualLayerManager>
</ControlTemplate>
</Panel>
</Border>
</VisualLayerManager>
</ControlTemplate>
<ControlTemplate x:Key="AppWindowDefaultTemplate" TargetType="{x:Type wnd:AppWindow}">
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<Panel Name="WindowBackground" IsHitTestVisible="False">
<Border Background="{DynamicResource SolidBackgroundFillColorBaseBrush}"
Opacity="{ReflectionBinding Value,Source={x:Static ms:UISettings.AcrylicOpacity},Mode=OneWay}">
</Border>
<Image Source="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImagePath},Path=Value, Mode=OneWay,Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImageStretch},Path=Value, Mode=OneWay}"
Opacity="{ReflectionBinding Value,Source={x:Static ms:UISettings.BackgroundImageOpacity},Mode=OneWay}"
IsVisible="{ReflectionBinding Source={x:Static ms:UISettings.EnableCustomBackgroundImage},Path=Value, Mode=OneWay}"/>
</Panel>
<Panel Background="Transparent" Margin="{TemplateBinding WindowDecorationMargin}" />
<VisualLayerManager>
<VisualLayerManager.ChromeOverlayLayer>
<TitleBar />
</VisualLayerManager.ChromeOverlayLayer>
<ContentPresenter Name="PART_ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</VisualLayerManager>
<wnd:AppSplashScreen Name="SplashHost"
IsVisible="False"/>
</Panel>
</ControlTemplate>
<ControlTemplate x:Key="AppWindowDefaultTemplate" TargetType="{x:Type wnd:AppWindow}">
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<Panel Name="WindowBackground" IsHitTestVisible="False">
<Border Background="{DynamicResource SolidBackgroundFillColorBaseBrush}" Opacity="{ReflectionBinding Value, Source={x:Static ms:UISettings.WindowBackgroundOpacity}, Mode=OneWay}" />
<Image
IsVisible="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImage},
Path=Value,
Mode=OneWay}"
Opacity="{ReflectionBinding Value,
Source={x:Static ms:UISettings.WindowBackgroundCustomImageOpacity},
Mode=OneWay}"
Source="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImagePath},
Path=Value,
Mode=OneWay,
Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImageStretch},
Path=Value,
Mode=OneWay}" />
</Panel>
<Panel Margin="{TemplateBinding WindowDecorationMargin}" Background="Transparent" />
<VisualLayerManager>
<VisualLayerManager.ChromeOverlayLayer>
<TitleBar />
</VisualLayerManager.ChromeOverlayLayer>
<ContentPresenter
Name="PART_ContentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
</VisualLayerManager>
<wnd:AppSplashScreen Name="SplashHost" IsVisible="False" />
</Panel>
</ControlTemplate>
<ControlTheme TargetType="wnd:AppWindow" x:Key="{x:Type wnd:AppWindow}">
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}"/>
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/>
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="Background" Value="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="Template" Value="{StaticResource AppWindowDefaultTemplate}" />
<ControlTheme x:Key="{x:Type wnd:AppWindow}" TargetType="wnd:AppWindow">
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="Background" Value="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="Template" Value="{StaticResource AppWindowDefaultTemplate}" />
<Style Selector="^:windows">
<Setter Property="Template" Value="{StaticResource AppWindowOnWindowsTemplate}" />
<Style Selector="^:icon">
<Style Selector="^ /template/ Image#Icon">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^ /template/ TextBlock#TitleText">
<Setter Property="Margin" Value="32 0 0 0" />
</Style>
</Style>
<Style Selector="^:windows">
<Setter Property="Template" Value="{StaticResource AppWindowOnWindowsTemplate}" />
<Style Selector="^:icon">
<Style Selector="^ /template/ Image#Icon">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^ /template/ TextBlock#TitleText">
<Setter Property="Margin" Value="32 0 0 0" />
</Style>
</Style>
<Style Selector="^:dialog">
<Style Selector="^ /template/ wnd|MinMaxCloseControl#SystemCaptionButtons">
<Setter Property="Margin" Value="0" />
</Style>
</Style>
<Style Selector="^:dialog">
<Style Selector="^ /template/ wnd|MinMaxCloseControl#SystemCaptionButtons">
<Setter Property="Margin" Value="0" />
</Style>
</Style>
<Style Selector="^[WindowState=FullScreen]">
<Style Selector="^ /template/ Panel#DefaultTitleBar">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ wnd|MinMaxCloseControl#SystemCaptionButtons">
<Setter Property="IsVisible" Value="False" />
</Style>
</Style>
<Style Selector="^[WindowState=FullScreen]">
<Style Selector="^ /template/ Panel#DefaultTitleBar">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ wnd|MinMaxCloseControl#SystemCaptionButtons">
<Setter Property="IsVisible" Value="False" />
</Style>
</Style>
<Style Selector="^[IsActive=False]">
<Style Selector="^ /template/ Panel#DefaultTitleBar">
<Setter Property="Background" Value="{DynamicResource FATitle_TitleBarBackgroundInactive}" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource FATitle_TitleBarForegroundInactive}" />
</Style>
</Style>
</Style>
<Style Selector="^[IsActive=False]">
<Style Selector="^ /template/ Panel#DefaultTitleBar">
<Setter Property="Background" Value="{DynamicResource FATitle_TitleBarBackgroundInactive}" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource FATitle_TitleBarForegroundInactive}" />
</Style>
</Style>
</Style>
<Style Selector="^:splashOpen">
<Style Selector="^ /template/ wnd|AppSplashScreen#SplashHost">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
<Style Selector="^:splashOpen">
<Style Selector="^ /template/ wnd|AppSplashScreen#SplashHost">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>
@@ -40,7 +40,7 @@ public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel> whe
//SystemDecorations = SystemDecorations.BorderOnly;
Background = null;
TransparencyBackgroundFallback = Brushes.Transparent;
TransparencyLevelHint = (WindowTransparencyLevel)UISettings.WindowBackgroundMateria.Value;
TransparencyLevelHint = (WindowTransparencyLevel)UISettings.WindowBackgroundMaterial.Value;
if (IsSaveWindowSize)
{
@@ -1,129 +1,143 @@
<UserControl x:Class="BD.WTTS.UI.Views.Pages.Settings_General"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:spp="https://steampp.net/ui"
xmlns:s="https://steampp.net/services"
xmlns:ms="https://steampp.net/settings"
xmlns:ui="using:FluentAvalonia.UI.Controls"
d:DesignHeight="680"
d:DesignWidth="1080"
x:DataType="spp:SettingsPageViewModel"
x:CompileBindings="True"
mc:Ignorable="d">
<StackPanel Margin="15" Spacing="5">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_General,Mode=OneWay,Source={x:Static s:ResourceService.Current}}" Margin="0 0 0 5"/>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_StartAutoRun,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="系统启动时程序自动运行">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE770;" FontFamily="{StaticResource SymbolThemeFontFamily}"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent"
IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.WindowsStartupAutoRun},Path=Value, Mode=TwoWay}"/>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<UserControl
x:Class="BD.WTTS.UI.Views.Pages.Settings_General"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://steampp.net/settings"
xmlns:s="https://steampp.net/services"
xmlns:spp="https://steampp.net/ui"
xmlns:ui="using:FluentAvalonia.UI.Controls"
d:DesignHeight="680"
d:DesignWidth="1080"
x:CompileBindings="True"
x:DataType="spp:SettingsPageViewModel"
mc:Ignorable="d">
<StackPanel Margin="15" Spacing="5">
<TextBlock Margin="0,0,0,5" Text="{ReflectionBinding Path=Res.Settings_General, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<spp:OptionsDisplayItem Description="系统启动时程序自动运行" Header="{ReflectionBinding Path=Res.Settings_General_StartAutoRun, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE770;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent" IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.AutoRunOnStartup}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_RuningMinimize,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="设置后程序启动时不再主动显示主窗口">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xEA6C;" FontFamily="{StaticResource SymbolThemeFontFamily}"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent"
IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsStartupAppMinimized},Path=Value, Mode=TwoWay}"/>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Description="设置后程序启动时不再主动显示主窗口" Header="{ReflectionBinding Path=Res.Settings_General_RuningMinimize, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xEA6C;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent" IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.MinimizeOnStartup}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_EnableTrayIcon,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="{ReflectionBinding Path=Res.Settings_General_EnableTrayIcon_Tip,Mode=OneWay,Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE9E9;" FontFamily="{StaticResource SymbolThemeFontFamily}"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent"
IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsEnableTrayIcon},Path=Value, Mode=TwoWay}"/>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Description="{ReflectionBinding Path=Res.Settings_General_EnableTrayIcon_Tip, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" Header="{ReflectionBinding Path=Res.Settings_General_EnableTrayIcon, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE9E9;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent" IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.TrayIcon}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_AutoCheckUpdate,Mode=OneWay,Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE895;" FontFamily="{StaticResource SymbolThemeFontFamily}"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent"
IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.IsAutoCheckUpdate},Path=Value, Mode=TwoWay}"/>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_AutoCheckUpdate, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE895;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent" IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.AutoCheckAppUpdate}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_UpdateChannel,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
IsVisible="{ReflectionBinding Path=!.,Source={spp:OnPlatform DesktopBridge}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE71D;" FontFamily="{StaticResource SymbolThemeFontFamily}"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ComboBox ItemsSource="{Binding UpdateChannels}"
SelectedItem="{ReflectionBinding Source={x:Static ms:GeneralSettings.UpdateChannel},Path=Value, Mode=TwoWay}">
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_UpdateChannel, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" IsVisible="{ReflectionBinding Path=!., Source={spp:OnPlatform DesktopBridge}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE71D;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ComboBox ItemsSource="{Binding UpdateChannels}" SelectedItem="{ReflectionBinding Source={x:Static ms:GeneralSettings.UpdateChannel}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_General_UseGPURendering,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="{ReflectionBinding Path=Res.Settings_RestartEffective,Mode=OneWay,Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE950;" FontFamily="Segoe Fluent Icons"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent"
IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.UseGPURendering},Path=Value, Mode=TwoWay}"/>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Description="{ReflectionBinding Path=Res.Settings_RestartEffective, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" Header="{ReflectionBinding Path=Res.Settings_General_UseGPURendering, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="&#xE950;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent" IsChecked="{ReflectionBinding Source={x:Static ms:GeneralSettings.GPU}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<ui:SettingsExpander IconSource="Globe"
Header="{ReflectionBinding Path=Res.Settings_General_StorageSpace,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
IsExpanded="True"
IsVisible="{spp:OnPlatform Windows}"
IsClickEnabled="False">
<ui:SettingsExpander.IconSource>
<ui:FontIconSource Glyph="&#xE7F1;" FontFamily="Segoe Fluent Icons"/>
</ui:SettingsExpander.IconSource>
<ui:SettingsExpander.Footer>
<Button Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static s:ResourceService.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=App}"
Command="{Binding OpenFolder_Click}"
CommandParameter="{x:Null}"/>
</ui:SettingsExpander.Footer>
<ui:SettingsExpander
Header="{ReflectionBinding Path=Res.Settings_General_StorageSpace,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IconSource="Globe"
IsClickEnabled="False"
IsExpanded="True"
IsVisible="{spp:OnPlatform Windows}">
<ui:SettingsExpander.IconSource>
<ui:FontIconSource FontFamily="Segoe Fluent Icons" Glyph="&#xE7F1;" />
</ui:SettingsExpander.IconSource>
<ui:SettingsExpander.Footer>
<Button
Command="{Binding OpenFolder_Click}"
CommandParameter="{x:Null}"
Content="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,
Mode=OneWay,
Source={x:Static s:ResourceService.Current},
Converter={StaticResource StringFormatConverter},
ConverterParameter=App}" />
</ui:SettingsExpander.Footer>
<ui:SettingsExpanderItem Content="AppData 数据"
ActionIconSource="ChevronRight"
IsClickEnabled="True"
ToolTip.Tip="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static s:ResourceService.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=AppData}"
Command="{Binding OpenFolder_Click}"
CommandParameter="AppData"/>
<ui:SettingsExpanderItem Content="Cache 数据"
ActionIconSource="ChevronRight"
IsClickEnabled="True"
ToolTip.Tip="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static s:ResourceService.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=Cache}"
Command="{Binding OpenFolder_Click}"
CommandParameter="Cache">
<ui:SettingsExpanderItem.Footer>
<TextBlock Name="CacheSize"
FontSize="{DynamicResource DefaultFontSize}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/>
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>
<ui:SettingsExpanderItem Content="Logs 数据"
ActionIconSource="ChevronRight"
IsClickEnabled="True"
ToolTip.Tip="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,Mode=OneWay,Source={x:Static s:ResourceService.Current},Converter={StaticResource StringFormatConverter},ConverterParameter=Logs}"
Command="{Binding OpenFolder_Click}"
CommandParameter="Logs">
<ui:SettingsExpanderItem.Footer>
<TextBlock Name="LogSize"
FontSize="{DynamicResource DefaultFontSize}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/>
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>
</ui:SettingsExpander>
</StackPanel>
<ui:SettingsExpanderItem
ActionIconSource="ChevronRight"
Command="{Binding OpenFolder_Click}"
CommandParameter="AppData"
Content="AppData 数据"
IsClickEnabled="True"
ToolTip.Tip="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,
Mode=OneWay,
Source={x:Static s:ResourceService.Current},
Converter={StaticResource StringFormatConverter},
ConverterParameter=AppData}" />
<ui:SettingsExpanderItem
ActionIconSource="ChevronRight"
Command="{Binding OpenFolder_Click}"
CommandParameter="Cache"
Content="Cache 数据"
IsClickEnabled="True"
ToolTip.Tip="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,
Mode=OneWay,
Source={x:Static s:ResourceService.Current},
Converter={StaticResource StringFormatConverter},
ConverterParameter=Cache}">
<ui:SettingsExpanderItem.Footer>
<TextBlock
Name="CacheSize"
FontSize="{DynamicResource DefaultFontSize}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>
<ui:SettingsExpanderItem
ActionIconSource="ChevronRight"
Command="{Binding OpenFolder_Click}"
CommandParameter="Logs"
Content="Logs 数据"
IsClickEnabled="True"
ToolTip.Tip="{ReflectionBinding Path=Res.Settings_General_BrowseCustomFolder,
Mode=OneWay,
Source={x:Static s:ResourceService.Current},
Converter={StaticResource StringFormatConverter},
ConverterParameter=Logs}">
<ui:SettingsExpanderItem.Footer>
<TextBlock
Name="LogSize"
FontSize="{DynamicResource DefaultFontSize}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>
</ui:SettingsExpander>
</StackPanel>
</UserControl>
@@ -1,339 +1,444 @@
<UserControl x:Class="BD.WTTS.UI.Views.Pages.Settings_UI"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:spp="https://steampp.net/ui"
xmlns:s="https://steampp.net/services"
xmlns:ms="https://steampp.net/settings"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:generic="using:System.Collections.Generic"
d:DesignHeight="680"
d:DesignWidth="1080"
x:DataType="spp:SettingsPageViewModel"
x:CompileBindings="True"
mc:Ignorable="d">
<StackPanel Margin="15" Spacing="5">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI,Mode=OneWay,Source={x:Static s:ResourceService.Current}}" Margin="0 0 0 5"/>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_Theme,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Icon="DarkTheme"
Description="设置程序的主题风格">
<spp:OptionsDisplayItem.ActionButton>
<ComboBox SelectedIndex="{Binding Source={x:Static ms:UISettings.Theme},Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"/>
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Light,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"/>
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Dark,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"/>
<!--<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_HighContrast,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"/>-->
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_ThemeAccent,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="设置程序中显示的强调色"
Icon="ColorLine"
Expands="True"
IsExpanded="{Binding Path=IsChecked, ElementName=AccentCustom, Mode=OneWay}">
<spp:OptionsDisplayItem.ActionButton>
<StackPanel Orientation="Horizontal" Spacing="10">
<RadioButton Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.GetUserThemeAccent},Path=Value, Mode=TwoWay}"/>
<RadioButton x:Name="AccentCustom"
Content="{ReflectionBinding Path=Res.Settings_UI_Custom,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.GetUserThemeAccent},Path=!Value, Mode=OneWay}"/>
</StackPanel>
</spp:OptionsDisplayItem.ActionButton>
<spp:OptionsDisplayItem.Content>
<StackPanel Spacing="4" >
<DockPanel LastChildFill="False" Margin="24 0 0 6">
<TextBlock Text="预览颜色"
VerticalAlignment="Center"
DockPanel.Dock="Left" />
<UserControl
x:Class="BD.WTTS.UI.Views.Pages.Settings_UI"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:generic="using:System.Collections.Generic"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ms="https://steampp.net/settings"
xmlns:s="https://steampp.net/services"
xmlns:spp="https://steampp.net/ui"
xmlns:ui="using:FluentAvalonia.UI.Controls"
d:DesignHeight="680"
d:DesignWidth="1080"
x:CompileBindings="True"
x:DataType="spp:SettingsPageViewModel"
mc:Ignorable="d">
<StackPanel Margin="15" Spacing="5">
<TextBlock Margin="0,0,0,5" Text="{ReflectionBinding Path=Res.Settings_UI, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<spp:OptionsDisplayItem
Description="设置程序的主题风格"
Header="{ReflectionBinding Path=Res.Settings_Theme,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
Icon="DarkTheme">
<spp:OptionsDisplayItem.ActionButton>
<ComboBox SelectedIndex="{Binding Source={x:Static ms:UISettings.Theme}, Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Light, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_Dark, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<!--<ComboBoxItem Content="{ReflectionBinding Path=Res.Settings_UI_HighContrast,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"/>-->
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem
Description="设置程序中显示的强调色"
Expands="True"
Header="{ReflectionBinding Path=Res.Settings_ThemeAccent,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
Icon="ColorLine"
IsExpanded="{Binding Path=IsChecked, ElementName=AccentCustom, Mode=OneWay}">
<spp:OptionsDisplayItem.ActionButton>
<StackPanel Orientation="Horizontal" Spacing="10">
<RadioButton Content="{ReflectionBinding Path=Res.Settings_UI_SystemDefault, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.UseSystemThemeAccent}, Path=Value, Mode=TwoWay}" />
<RadioButton
x:Name="AccentCustom"
Content="{ReflectionBinding Path=Res.Settings_UI_Custom,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.UseSystemThemeAccent},
Path=!Value,
Mode=OneWay}" />
</StackPanel>
</spp:OptionsDisplayItem.ActionButton>
<spp:OptionsDisplayItem.Content>
<StackPanel Spacing="4">
<DockPanel Margin="24,0,0,6" LastChildFill="False">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="预览颜色" />
<Grid RowDefinitions="*,*,*,*" ColumnDefinitions="*,*"
HorizontalAlignment="Left"
DockPanel.Dock="Right">
<Border Background="{DynamicResource SystemAccentColor}"
Height="40" Grid.ColumnSpan="2">
<TextBlock Text="SystemAccentColor"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid
HorizontalAlignment="Left"
ColumnDefinitions="*,*"
DockPanel.Dock="Right"
RowDefinitions="*,*,*,*">
<Border
Grid.ColumnSpan="2"
Height="40"
Background="{DynamicResource SystemAccentColor}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="SystemAccentColor" />
</Border>
<Border Background="{DynamicResource SystemAccentColorLight1}"
Height="40" Width="90" Grid.Column="0" Grid.Row="1">
<TextBlock Text="Light1"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Background="{DynamicResource SystemAccentColorLight2}"
Height="40" Width="90" Grid.Column="0" Grid.Row="2">
<TextBlock Text="Light2"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Background="{DynamicResource SystemAccentColorLight3}"
Height="40" Width="90" Grid.Column="0" Grid.Row="3">
<TextBlock Text="Light3"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border
Grid.Row="1"
Grid.Column="0"
Width="90"
Height="40"
Background="{DynamicResource SystemAccentColorLight1}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="Light1" />
</Border>
<Border
Grid.Row="2"
Grid.Column="0"
Width="90"
Height="40"
Background="{DynamicResource SystemAccentColorLight2}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="Light2" />
</Border>
<Border
Grid.Row="3"
Grid.Column="0"
Width="90"
Height="40"
Background="{DynamicResource SystemAccentColorLight3}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="Light3" />
</Border>
<Border Background="{DynamicResource SystemAccentColorDark1}"
Height="40" Width="90" Grid.Column="1" Grid.Row="1">
<TextBlock Text="Dark1"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Background="{DynamicResource SystemAccentColorDark2}"
Height="40" Width="90" Grid.Column="1" Grid.Row="2">
<TextBlock Text="Dark2"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Background="{DynamicResource SystemAccentColorDark3}"
Height="40" Width="90" Grid.Column="1" Grid.Row="3">
<TextBlock Text="Dark3"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</Grid>
</DockPanel>
<Border
Grid.Row="1"
Grid.Column="1"
Width="90"
Height="40"
Background="{DynamicResource SystemAccentColorDark1}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="Dark1" />
</Border>
<Border
Grid.Row="2"
Grid.Column="1"
Width="90"
Height="40"
Background="{DynamicResource SystemAccentColorDark2}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="Dark2" />
</Border>
<Border
Grid.Row="3"
Grid.Column="1"
Width="90"
Height="40"
Background="{DynamicResource SystemAccentColorDark3}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Text="Dark3" />
</Border>
</Grid>
</DockPanel>
<Border Background="{DynamicResource ApplicationPageBackgroundThemeBrush}"
Height="1"
Margin="-20"/>
<Border
Height="1"
Margin="-20"
Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<TextBlock Text="Windows 颜色"
Margin="24 24 0 0"/>
<TextBlock Margin="24,24,0,0" Text="Windows 颜色" />
<ListBox Name="ColorListBox"
SelectedItem="{ReflectionBinding Source={x:Static ms:UISettings.ThemeAccent},Converter={StaticResource ColorStringToBrushConverter},Path=Value, Mode=TwoWay}"
MaxWidth="441"
AutoScrollToSelectedItem="False"
Margin="24 0 24 12"
HorizontalAlignment="Left">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox
Name="ColorListBox"
MaxWidth="441"
Margin="24,0,24,12"
HorizontalAlignment="Left"
AutoScrollToSelectedItem="False"
SelectedItem="{ReflectionBinding Source={x:Static ms:UISettings.ThemeAccent},
Converter={StaticResource ColorStringToBrushConverter},
Path=Value,
Mode=TwoWay}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Width" Value="48" />
<Setter Property="Height" Value="48" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Margin" Value="1 1 0 0" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
<Border CornerRadius="{StaticResource ControlCornerRadius}"
BorderThickness="2"
Name="Root">
<Border.Background>
<SolidColorBrush Color="{Binding}" />
</Border.Background>
</Border>
<ListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Width" Value="48" />
<Setter Property="Height" Value="48" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Margin" Value="1 1 0 0" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
<Border
Name="Root"
BorderThickness="2"
CornerRadius="{StaticResource ControlCornerRadius}">
<Border.Background>
<SolidColorBrush Color="{Binding}" />
</Border.Background>
</Border>
<Border Name="Check"
Background="{DynamicResource FocusStrokeColorOuter}"
Width="20" Height="20"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0 2 2 0">
<ui:SymbolIcon Symbol="Checkmark"
Foreground="{DynamicResource SystemAccentColor}"
FontSize="18"/>
</Border>
</Panel>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="ListBoxItem /template/ Border#Check">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ Border#Root">
<Setter Property="BorderBrush" Value="{DynamicResource FocusStrokeColorOuter}" />
</Style>
<Border
Name="Check"
Width="20"
Height="20"
Margin="0,2,2,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="{DynamicResource FocusStrokeColorOuter}">
<ui:SymbolIcon
FontSize="18"
Foreground="{DynamicResource SystemAccentColor}"
Symbol="Checkmark" />
</Border>
</Panel>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="ListBoxItem /template/ Border#Check">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="ListBoxItem:pointerover /template/ Border#Root">
<Setter Property="BorderBrush" Value="{DynamicResource FocusStrokeColorOuter}" />
</Style>
<Style Selector="ListBoxItem:selected /template/ Border#Root">
<Setter Property="BorderBrush" Value="{DynamicResource FocusStrokeColorOuter}" />
</Style>
<Style Selector="ListBoxItem:selected /template/ Border#Check">
<Setter Property="IsVisible" Value="True" />
</Style>
</ListBox.Styles>
<Style Selector="ListBoxItem:selected /template/ Border#Root">
<Setter Property="BorderBrush" Value="{DynamicResource FocusStrokeColorOuter}" />
</Style>
<Style Selector="ListBoxItem:selected /template/ Border#Check">
<Setter Property="IsVisible" Value="True" />
</Style>
</ListBox.Styles>
</ListBox>
</ListBox>
<Border Background="{DynamicResource ApplicationPageBackgroundThemeBrush}"
Height="1"
Margin="-20"/>
<Border
Height="1"
Margin="-20"
Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<DockPanel LastChildFill="False" Margin="24 6 0 0">
<TextBlock Text="自定义颜色"
VerticalAlignment="Center"
DockPanel.Dock="Left" />
<DockPanel Margin="24,6,0,0" LastChildFill="False">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="自定义颜色" />
<ui:ColorPickerButton Color="{ReflectionBinding Source={x:Static ms:UISettings.ThemeAccent},Converter={StaticResource ColorStringToBrushConverter},Path=Value, Mode=TwoWay}"
IsMoreButtonVisible="True"
UseSpectrum="True"
UseColorWheel="False"
UseColorTriangle="False"
UseColorPalette="False"
IsCompact="True"
ShowAcceptDismissButtons="True"
DockPanel.Dock="Right"/>
</DockPanel>
</StackPanel>
</spp:OptionsDisplayItem.Content>
</spp:OptionsDisplayItem>
<ui:ColorPickerButton
DockPanel.Dock="Right"
IsCompact="True"
IsMoreButtonVisible="True"
ShowAcceptDismissButtons="True"
UseColorPalette="False"
UseColorTriangle="False"
UseColorWheel="False"
UseSpectrum="True"
Color="{ReflectionBinding Source={x:Static ms:UISettings.ThemeAccent},
Converter={StaticResource ColorStringToBrushConverter},
Path=Value,
Mode=TwoWay}" />
</DockPanel>
</StackPanel>
</spp:OptionsDisplayItem.Content>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_Language,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="设置程序首选的显示语言"
Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xF2B7;" FontFamily="Segoe Fluent Icons"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ComboBox SelectedItem="{Binding SelectLanguage, Mode=TwoWay}"
ItemsSource="{x:Static s:ResourceService.Languages}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{ReflectionBinding Value,Mode=OneWay}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem
Description="设置程序首选的显示语言"
Header="{ReflectionBinding Path=Res.Settings_Language,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="&#xF2B7;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ComboBox ItemsSource="{x:Static s:ResourceService.Languages}" SelectedItem="{Binding SelectLanguage, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{ReflectionBinding Value, Mode=OneWay}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_Fonts,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="设置程序首选的字体"
Icon="Font"
Navigates="False">
<spp:OptionsDisplayItem.ActionButton>
<ComboBox ItemsSource="{ReflectionBinding Mode=OneWay,Source={x:Static s:ResourceService.Fonts}}"
SelectedItem="{Binding SelectFont}"
AutoScrollToSelectedItem="True"
MaxDropDownHeight="300">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{ReflectionBinding Key,Mode=OneWay}"
FontFamily="{ReflectionBinding Value,Mode=OneWay,Converter={StaticResource NameToFontFamilyConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem
Description="设置程序首选的字体"
Header="{ReflectionBinding Path=Res.Settings_Fonts,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
Icon="Font"
Navigates="False">
<spp:OptionsDisplayItem.ActionButton>
<ComboBox
AutoScrollToSelectedItem="True"
ItemsSource="{ReflectionBinding Mode=OneWay,
Source={x:Static s:ResourceService.Fonts}}"
MaxDropDownHeight="300"
SelectedItem="{Binding SelectFont}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock FontFamily="{ReflectionBinding Value, Mode=OneWay, Converter={StaticResource NameToFontFamilyConverter}}" Text="{ReflectionBinding Key, Mode=OneWay}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_UI_WindowTransparencyMaterial,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Description="设置窗口背景透明效果和透明材质"
Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xF4A5;" FontFamily="Segoe Fluent Icons"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ComboBox SelectedIndex="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundMateria},Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="None"/>
<ComboBoxItem Content="Transparent"/>
<ComboBoxItem Content="Blur"/>
<ComboBoxItem Content="AcrylicBlur"/>
<ComboBoxItem Content="ForceAcrylicBlur"/>
<ComboBoxItem Content="Mica" IsVisible="{spp:OnPlatform Windows11AtLeast}"/>
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem
Description="设置窗口背景透明效果和透明材质"
Header="{ReflectionBinding Path=Res.Settings_UI_WindowTransparencyMaterial,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="&#xF4A5;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ComboBox SelectedIndex="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundMaterial}, Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="None" />
<ComboBoxItem Content="Transparent" />
<ComboBoxItem Content="Blur" />
<ComboBoxItem Content="AcrylicBlur" />
<ComboBoxItem Content="ForceAcrylicBlur" />
<ComboBoxItem Content="Mica" IsVisible="{spp:OnPlatform Windows11AtLeast}" />
</ComboBox>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_UI_BackgroundOpacity,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE706;" FontFamily="{StaticResource SymbolThemeFontFamily}"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<Slider Value="{ReflectionBinding Value,Source={x:Static ms:UISettings.AcrylicOpacity},Mode=TwoWay}"
MinWidth="250"
Minimum="0"
Maximum="1.0"/>
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_UI_BackgroundOpacity, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xE706;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<Slider
MinWidth="250"
Maximum="1.0"
Minimum="0"
Value="{ReflectionBinding Value,
Source={x:Static ms:UISettings.WindowBackgroundOpacity},
Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
</spp:OptionsDisplayItem>
<spp:OptionsDisplayItem Header="{ReflectionBinding Path=Res.Settings_UI_CustomBackgroundImage,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Expands="True"
Navigates="False"
IsExpanded="{ReflectionBinding Source={x:Static ms:UISettings.EnableCustomBackgroundImage},Path=Value, Mode=OneWay}">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon Glyph="&#xE91B;" FontFamily="Segoe Fluent Icons"/>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent"
IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.EnableCustomBackgroundImage},Path=Value, Mode=TwoWay}"/>
</spp:OptionsDisplayItem.ActionButton>
<spp:OptionsDisplayItem
Expands="True"
Header="{ReflectionBinding Path=Res.Settings_UI_CustomBackgroundImage,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
IsExpanded="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImage},
Path=Value,
Mode=OneWay}"
Navigates="False">
<spp:OptionsDisplayItem.Icon>
<ui:FontIcon FontFamily="Segoe Fluent Icons" Glyph="&#xE91B;" />
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<ToggleSwitch Classes="LeftContent" IsChecked="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImage}, Path=Value, Mode=TwoWay}" />
</spp:OptionsDisplayItem.ActionButton>
<spp:OptionsDisplayItem.Content>
<StackPanel Spacing="4" >
<DockPanel LastChildFill="False" Margin="24 0 0 6">
<TextBlock Text="预览图片"
VerticalAlignment="Center"
DockPanel.Dock="Left" />
<spp:OptionsDisplayItem.Content>
<StackPanel Spacing="4">
<DockPanel Margin="24,0,0,6" LastChildFill="False">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="预览图片" />
<Image Source="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImagePath},Path=Value, Mode=OneWay,Converter={StaticResource BitmapAssetValueConverter}}"
DockPanel.Dock="Right"
HorizontalAlignment="Left"
Stretch="{ReflectionBinding Source={x:Static ms:UISettings.BackgroundImageStretch},Path=Value, Mode=OneWay}"
Width="250"
Height="150"/>
</DockPanel>
<Image
Width="250"
Height="150"
HorizontalAlignment="Left"
DockPanel.Dock="Right"
Source="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImagePath},
Path=Value,
Mode=OneWay,
Converter={StaticResource BitmapAssetValueConverter}}"
Stretch="{ReflectionBinding Source={x:Static ms:UISettings.WindowBackgroundCustomImageStretch},
Path=Value,
Mode=OneWay}" />
</DockPanel>
<Border Background="{DynamicResource ApplicationPageBackgroundThemeBrush}"
Height="1"
Margin="-20"/>
<Border
Height="1"
Margin="-20"
Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<DockPanel LastChildFill="False" Margin="24 6 0 6">
<TextBlock Text="{ReflectionBinding Path=Res.Settings_UI_BackgroundImageOpacity,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
VerticalAlignment="Center"
DockPanel.Dock="Left" />
<Slider Value="{ReflectionBinding Value,Source={x:Static ms:UISettings.BackgroundImageOpacity},Mode=TwoWay}"
DockPanel.Dock="Right"
MinWidth="250"
Minimum="0"
Maximum="1.0"/>
</DockPanel>
<Border Background="{DynamicResource ApplicationPageBackgroundThemeBrush}"
Height="1"
Margin="-20"/>
<DockPanel Margin="24,6,0,6" LastChildFill="False">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="{ReflectionBinding Path=Res.Settings_UI_BackgroundImageOpacity,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}" />
<Slider
MinWidth="250"
DockPanel.Dock="Right"
Maximum="1.0"
Minimum="0"
Value="{ReflectionBinding Value,
Source={x:Static ms:UISettings.WindowBackgroundOpacity},
Mode=TwoWay}" />
</DockPanel>
<Border
Height="1"
Margin="-20"
Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<DockPanel LastChildFill="False" Margin="24 6 0 6">
<TextBlock Text="选择一张照片"
VerticalAlignment="Center"
DockPanel.Dock="Left" />
<Button DockPanel.Dock="Right"
MinWidth="150"
Content="{ReflectionBinding Path=Res.Settings_UI_SelectImage,Mode=OneWay,Source={x:Static s:ResourceService.Current}}"
Command="{Binding SelectImage_Click}"/>
</DockPanel>
<DockPanel Margin="24,6,0,6" LastChildFill="False">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="选择一张照片" />
<Button
MinWidth="150"
Command="{Binding SelectImage_Click}"
Content="{ReflectionBinding Path=Res.Settings_UI_SelectImage,
Mode=OneWay,
Source={x:Static s:ResourceService.Current}}"
DockPanel.Dock="Right" />
</DockPanel>
<Border Background="{DynamicResource ApplicationPageBackgroundThemeBrush}"
Height="1"
Margin="-20"/>
<Border
Height="1"
Margin="-20"
Background="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
<DockPanel LastChildFill="False" Margin="24 6 0 0">
<TextBlock Text="选择图片缩放方式"
VerticalAlignment="Center"
DockPanel.Dock="Left" />
<ComboBox DockPanel.Dock="Right"
MinWidth="150"
SelectedIndex="{Binding Source={x:Static ms:UISettings.BackgroundImageStretch},Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="{x:Static Stretch.Fill}" />
<ComboBoxItem Content="{x:Static Stretch.None}" />
<ComboBoxItem Content="{x:Static Stretch.Uniform}" />
<ComboBoxItem Content="{x:Static Stretch.UniformToFill}" />
</ComboBox>
</DockPanel>
</StackPanel>
</spp:OptionsDisplayItem.Content>
</spp:OptionsDisplayItem>
</StackPanel>
<DockPanel Margin="24,6,0,0" LastChildFill="False">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
Text="选择图片缩放方式" />
<ComboBox
MinWidth="150"
DockPanel.Dock="Right"
SelectedIndex="{Binding Source={x:Static ms:UISettings.WindowBackgroundCustomImageStretch}, Path=Value, Mode=TwoWay}">
<ComboBoxItem Content="{x:Static Stretch.Fill}" />
<ComboBoxItem Content="{x:Static Stretch.None}" />
<ComboBoxItem Content="{x:Static Stretch.Uniform}" />
<ComboBoxItem Content="{x:Static Stretch.UniformToFill}" />
</ComboBox>
</DockPanel>
</StackPanel>
</spp:OptionsDisplayItem.Content>
</spp:OptionsDisplayItem>
</StackPanel>
</UserControl>
@@ -512,7 +512,7 @@ internal sealed class HostsFileServiceImpl
/// 获取 hosts 文件编码
/// </summary>
/// <returns></returns>
Encoding GetEncoding() => GeneralSettings.HostsEncodingType.Value switch
Encoding GetEncoding() => GeneralSettings.HostsFileEncodingType.Value switch
{
EncodingType.ANSICodePage => s.Default,
EncodingType.UTF8 => Encoding.Default,
@@ -36,20 +36,13 @@ sealed class SteamServiceImpl2 : SteamServiceBaseImpl, ISteamConnectService
public override ISteamConnectService Conn => this;
protected override string AppResources_SaveEditedAppInfo_SaveFailed => AppResources.SaveEditedAppInfo_SaveFailed;
protected override string? StratSteamDefaultParameter => SteamSettings.SteamStratParameter.Value;
protected override string SteamSettings_StratParameter => SteamSettings.SteamStratParameter.Value;
protected override bool IsRunSteamAdministrator => SteamSettings.IsRunSteamAdministrator.Value;
protected override bool SteamSettings_IsRunSteamAdministrator => SteamSettings.IsRunSteamAdministrator.Value;
protected override Dictionary<uint, string?>? HideGameList => serviceProvider.GetService<IGameLibrarySettings>()?.HideGameList;
protected override Dictionary<uint, string?> GameLibrarySettings_HideGameList
{
get
{
return serviceProvider.GetService<IGameLibrarySettings>()?.HideGameList ?? new();
//return GameLibrarySettings.HideGameList.Value;
}
}
//protected override string? GetString(string name) => AppResources.ResourceManager.GetString(name);
protected override Process? StartAsInvoker(string fileName, string? arguments = null)
{
@@ -54,7 +54,7 @@ public sealed class AdvertiseService : ReactiveObject
AdvertisementsSource.CountChanged
.Subscribe(_ => CheckShow());
UISettings.IsShowAdvertise.Subscribe(_ => CheckShow());
UISettings.IsShowAdvertisement.Subscribe(_ => CheckShow());
//this.WhenValueChanged(x => x.IsShowAdvertise, false)
// .Subscribe(async x =>
@@ -114,7 +114,7 @@ public sealed class AdvertiseService : ReactiveObject
if (UserService.Current.User != null && UserService.Current.User.UserType == UserType.Sponsor)
{
if (!UISettings.IsShowAdvertise.Value)
if (!UISettings.IsShowAdvertisement.Value)
{
IsShowAdvertise = false;
return;
@@ -1,124 +0,0 @@
//// ReSharper disable once CheckNamespace
//namespace BD.WTTS.Settings;
//public sealed partial class GeneralSettings : SettingsHost2<GeneralSettings>
//{
// /// <summary>
// /// 自动检查更新
// /// </summary>
// public static SerializableProperty<bool> IsAutoCheckUpdate { get; }
// = GetProperty(defaultValue: true);
// /// <summary>
// /// 下载更新渠道
// /// </summary>
// public static SerializableProperty<UpdateChannelType> UpdateChannel { get; }
// = GetProperty(defaultValue: default(UpdateChannelType));
//#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
// static readonly SerializableProperty<bool> _WindowsStartupAutoRun = GetProperty(defaultValue: false);
// /// <summary>
// /// 程序是否开机自启动
// /// </summary>
// public static SerializableProperty<bool> WindowsStartupAutoRun => _WindowsStartupAutoRun;
// static readonly SerializableProperty<bool> _IsStartupAppMinimized = GetProperty(defaultValue: false);
// /// <summary>
// /// 程序启动时最小化
// /// </summary>
// public static SerializableProperty<bool> IsStartupAppMinimized => _IsStartupAppMinimized;
// static readonly SerializableProperty<bool> _IsEnableTrayIcon = GetProperty(defaultValue: true);
// /// <summary>
// /// 启用托盘
// /// </summary>
// public static SerializableProperty<bool> IsEnableTrayIcon => _IsEnableTrayIcon;
// static readonly SerializableProperty<bool> _IsSteamAppListLocalCache
// = GetProperty(defaultValue: true);
// /// <summary>
// /// 启用游戏列表本地缓存
// /// </summary>
// public static SerializableProperty<bool> IsSteamAppListLocalCache => _IsSteamAppListLocalCache;
// static readonly SerializableProperty<IReadOnlyDictionary<Platform, string>> _TextReaderProvider = GetProperty(defaultValue: (IReadOnlyDictionary<Platform, string>?)null);
// /// <summary>
// /// 用户设置的文本阅读器提供商,根据平台值不同,值格式为 枚举字符串 或 程序路径
// /// </summary>
// public static SerializableProperty<IReadOnlyDictionary<Platform, string>> TextReaderProvider => _TextReaderProvider ?? throw new PlatformNotSupportedException();
// static readonly SerializableProperty<EncodingType> _HostsEncodingType = GetProperty(defaultValue: default(EncodingType));
// /// <summary>
// /// Hosts 文件编码类型
// /// </summary>
// public static SerializableProperty<EncodingType> HostsEncodingType => _HostsEncodingType;
// static readonly SerializableProperty<bool> _UseGPURendering = GetProperty(defaultValue: true);
// /// <summary>
// /// 使用硬件加速
// /// </summary>
// public static SerializableProperty<bool> UseGPURendering => _UseGPURendering;
// static readonly SerializableProperty<bool> _UseWgl = GetProperty(defaultValue: false);
// /// <summary>
// /// (仅 Windows)Avalonia would try to use native Widows OpenGL when set to true. The default value is false.
// /// </summary>
// [SupportedOSPlatform("Windows")]
// public static SerializableProperty<bool> UseWgl => _UseWgl;
// ///// <summary>
// ///// 使用 Direct2D1 渲染(仅 Windows)
// ///// </summary>
// //public static SerializableProperty<bool> UseDirect2D1 { get; }
// // = GetProperty(defaultValue: false, autoSave: true);
// ///// <summary>
// ///// 创建桌面快捷方式
// ///// </summary>
// //public static SerializableProperty<bool> CreateDesktopShortcut { get; }
// // = new SerializableProperty<bool>(GetKey(), Providers.Roaming, false) { AutoSave = true };
// ///// <summary>
// ///// 是否显示起始页
// ///// </summary>
// //public static SerializableProperty<bool> IsShowStartPage { get; }
// // = GetProperty(defaultValue: true, autoSave: true);
// ///// <summary>
// ///// 启用错误日志记录
// ///// </summary>
// //public static SerializableProperty<bool> IsEnableLogRecord { get; }
// // = GetProperty(defaultValue: false, autoSave: true);
// //static readonly SerializableProperty<bool> _UseWinHttpHandler = GetProperty(defaultValue: false);
// ///// <summary>
// ///// (仅 Windows)使用基于 Windows 的 WinHTTP 接口处理消息
// ///// <para>https://docs.microsoft.com/zh-cn/dotnet/api/system.net.http.winhttphandler?view=dotnet-plat-ext-6.0</para>
// ///// <para>https://docs.microsoft.com/zh-cn/dotnet/api/system.net.http.socketshttphandler?view=net-6.0</para>
// ///// </summary>
// //[SupportedOSPlatform("Windows")]
// //public static SerializableProperty<bool> UseWinHttpHandler => _UseWinHttpHandler;
//#endif
//#if ANDROID
// static readonly SerializableProperty<bool> _CaptureScreen = GetProperty(defaultValue: false);
// /// <summary>
// /// 屏幕捕获(允许截图)
// /// </summary>
// public static SerializableProperty<bool> CaptureScreen => _CaptureScreen;
//#endif
//}
-166
View File
@@ -1,166 +0,0 @@
//// ReSharper disable once CheckNamespace
//namespace BD.WTTS.Settings;
//public sealed partial class UISettings : SettingsHost2<UISettings>
//{
// /// <summary>
// /// 主题
// /// </summary>
// public static SerializableProperty<short> Theme { get; }
// = GetProperty(defaultValue: (short)0);
// /// <summary>
// /// 语言
// /// </summary>
// public static SerializableProperty<string> Language { get; }
// = GetProperty(defaultValue: string.Empty);
// /// <summary>
// /// 不再提示的消息框数组
// /// </summary>
// public static SerializableProperty<HashSet<MessageBox.DontPromptType>?> DoNotShowMessageBoxs { get; }
// = GetProperty<HashSet<MessageBox.DontPromptType>?>(defaultValue: null, autoSave: true);
// /// <summary>
// /// 是否显示广告
// /// </summary>
// public static SerializableProperty<bool> IsShowAdvertise { get; }
// = GetProperty(defaultValue: true);
//#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
// static readonly SerializableProperty<ConcurrentDictionary<string, SizePosition>>? _WindowSizePositions = IApplication.IsDesktop() ?
// GetProperty(defaultValue: new ConcurrentDictionary<string, SizePosition>(), autoSave: true) : null;
// /// <summary>
// /// 所有窗口位置记忆字典集合
// /// </summary>
// public static SerializableProperty<ConcurrentDictionary<string, SizePosition>> WindowSizePositions => _WindowSizePositions ?? throw new PlatformNotSupportedException();
// static readonly SerializableProperty<string> _FontName = GetProperty(defaultValue: IFontManager.KEY_Default);
// /// <summary>
// /// 字体
// /// </summary>
// public static SerializableProperty<string> FontName => _FontName;
// static readonly SerializableProperty<double> _AcrylicOpacity = GetProperty(defaultValue: .8);
// /// <summary>
// /// 窗口背景不透明度
// /// </summary>
// public static SerializableProperty<double> AcrylicOpacity => _AcrylicOpacity;
// static readonly SerializableProperty<int> _WindowBackgroundMateria = GetProperty(defaultValue: /*OperatingSystem2.IsWindows7() ? 0 : (*/OperatingSystem2.IsWindows11AtLeast() ? 5 : 3)/*)*/;
// /// <summary>
// /// 窗口背景材质
// /// </summary>
// public static SerializableProperty<int> WindowBackgroundMateria => _WindowBackgroundMateria;
// static readonly SerializableProperty<int> _AppGridSize = GetProperty(defaultValue: 150);
// /// <summary>
// /// 库存游戏封面大小
// /// </summary>
// public static SerializableProperty<int> AppGridSize => _AppGridSize;
// static readonly SerializableProperty<bool> _SteamAccountRemarkReplaceName = GetProperty(defaultValue: false);
// /// <summary>
// /// Steam 账号备注替换名称显示
// /// </summary>
// public static SerializableProperty<bool> SteamAccountRemarkReplaceName => _SteamAccountRemarkReplaceName;
// static readonly SerializableProperty<bool> _EnableFilletUI = GetProperty(defaultValue: false);
// /// <summary>
// /// 启用圆角界面
// /// </summary>
// public static SerializableProperty<bool> EnableFilletUI => _EnableFilletUI;
// static readonly SerializableProperty<bool> _EnableDesktopBackground = GetProperty(defaultValue: false);
// /// <summary>
// /// 启用动态桌面背景
// /// </summary>
// public static SerializableProperty<bool> EnableDesktopBackground => _EnableDesktopBackground;
// static readonly SerializableProperty<bool> _EnableCustomBackgroundImage
// = GetProperty(defaultValue: false);
// /// <summary>
// /// 启用自定义背景图片
// /// </summary>
// public static SerializableProperty<bool> EnableCustomBackgroundImage => _EnableCustomBackgroundImage;
// static readonly SerializableProperty<string> _BackgroundImagePath = GetProperty(defaultValue: "/UI/Assets/back.png");
// /// <summary>
// /// 背景图片路径
// /// </summary>
// public static SerializableProperty<string> BackgroundImagePath => _BackgroundImagePath;
// static readonly SerializableProperty<double> _BackgroundImageOpacity = GetProperty(defaultValue: .8);
// /// <summary>
// /// 背景图片不透明度
// /// </summary>
// public static SerializableProperty<double> BackgroundImageOpacity => _BackgroundImageOpacity;
// static readonly SerializableProperty<int> _BackgroundImageStretch = GetProperty(defaultValue: 3);
// /// <summary>
// /// 背景图片缩放方式
// /// </summary>
// public static SerializableProperty<int> BackgroundImageStretch => _BackgroundImageStretch;
// static readonly SerializableProperty<string> _ThemeAccent = GetProperty(defaultValue: "#FF0078D7");
// /// <summary>
// /// 主题颜色(十六进制字符串)
// /// </summary>
// public static SerializableProperty<string> ThemeAccent => _ThemeAccent;
// static readonly SerializableProperty<bool> _GetUserThemeAccent = GetProperty(defaultValue: true);
// /// <summary>
// /// 主题颜色从系统获取
// /// </summary>
// public static SerializableProperty<bool> GetUserThemeAccent => _GetUserThemeAccent;
// static readonly SerializableProperty<bool> _MainMenuExpandedState = GetProperty(defaultValue: false);
// /// <summary>
// /// 主菜单展开状态
// /// </summary>
// public static SerializableProperty<bool> MainMenuExpandedState => _MainMenuExpandedState;
//#endif
//}
////static void EnableDesktopBackground_ValueChanged(object? sender, ValueChangedEventArgs<bool> e)
////{
//// if (e.NewValue)
//// {
//// IApplication.Instance.SetDesktopBackgroundWindow();
//// }
//// else
//// {
//// INativeWindowApiService.Instance.ResetWallerpaper();
//// }
////}
////static void Theme_ValueChanged(object sender, ValueChangedEventArgs<short> e)
////{
//// // 当前 Avalonia App 主题切换存在问题
//// //if (OperatingSystem2.Application.UseAvalonia()) return;
//// if (e.NewValue != e.OldValue)
//// {
//// var value = (AppTheme)e.NewValue;
//// if (value.IsDefined())
//// {
//// IApplication.Instance.Theme = value;
//// }
//// }
////}
+1 -1
View File
@@ -139,6 +139,6 @@ public static class UISettings
public static SettingsProperty<double, UISettings_> WindowBackgroundCustomImageOpacity { get; } = new();
/// <inheritdoc cref="IUISettings.WindowBackgroundCustomImageStretch"/>
public static SettingsProperty<XamlMediaStretch, UISettings_> LanguaWindowBackgroundCustomImageStretchge { get; } = new();
public static SettingsProperty<XamlMediaStretch, UISettings_> WindowBackgroundCustomImageStretch { get; } = new();
}
@@ -35,7 +35,7 @@ partial class Startup // OnStartup
{
await ActiveUserRecordAsync(ActiveUserAnonymousStatisticType.OnStartup);
});
if (GeneralSettings.IsAutoCheckUpdate.Value)
if (GeneralSettings.AutoCheckAppUpdate.Value)
{
Task.Run(async () =>
{
@@ -107,9 +107,9 @@ public sealed partial class SettingsPageViewModel : TabItemViewModel
#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
public void SetBackgroundImagePath(string? imagePath)
{
if (imagePath == null)
if (string.IsNullOrWhiteSpace(imagePath))
{
UISettings.BackgroundImagePath.Reset();
UISettings.WindowBackgroundCustomImagePath.Value = string.Empty;
return;
}
if (File.Exists(imagePath))
@@ -119,7 +119,7 @@ public sealed partial class SettingsPageViewModel : TabItemViewModel
var (isImage, _) = FileFormat.IsImage(stream);
if (isImage)
{
UISettings.BackgroundImagePath.Value = imagePath;
UISettings.WindowBackgroundCustomImagePath.Value = imagePath;
return;
}
}
+6 -6
View File
@@ -122,7 +122,7 @@ public static partial class MessageBox
var isDoNotShow = rememberChooseKey != DontPromptType.Undefined;
if (isDoNotShow &&
UISettings.DoNotShowMessageBoxs.Value?.Contains(rememberChooseKey) == true)
UISettings.MessageBoxDontPrompts.Value?.Contains(rememberChooseKey) == true)
{
return Result.OK;
}
@@ -139,18 +139,18 @@ public static partial class MessageBox
if (r && viewModel.RememberChoose && isDoNotShow)
{
if (UISettings.DoNotShowMessageBoxs.Value == null)
if (UISettings.MessageBoxDontPrompts.Value == null)
{
UISettings.DoNotShowMessageBoxs.Value = new() { rememberChooseKey };
UISettings.MessageBoxDontPrompts.Value = new() { rememberChooseKey };
}
else
{
if (UISettings.DoNotShowMessageBoxs.Value.Contains(rememberChooseKey) == false)
if (UISettings.MessageBoxDontPrompts.Value.Contains(rememberChooseKey) == false)
{
UISettings.DoNotShowMessageBoxs.Value.Add(rememberChooseKey);
UISettings.MessageBoxDontPrompts.Value.Add(rememberChooseKey);
}
}
UISettings.DoNotShowMessageBoxs.RaiseValueChanged();
UISettings.MessageBoxDontPrompts.RaiseValueChanged();
}
return r ? Result.OK : Result.Cancel;