mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-24 10:49:51 +08:00
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System;
|
|
using System.Application.Serialization;
|
|
using System.Application.UI;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace System.Application.Models.Settings
|
|
{
|
|
public static class UISettings
|
|
{
|
|
static UISettings()
|
|
{
|
|
//Theme.ValueChanged += Theme_ValueChanged;
|
|
}
|
|
|
|
private static void Theme_ValueChanged(object sender, ValueChangedEventArgs<short> e)
|
|
{
|
|
if (e.NewValue != e.OldValue)
|
|
{
|
|
switch (e.NewValue)
|
|
{
|
|
case 0:
|
|
AppHelper.Current.Theme = AppTheme.Light;
|
|
break;
|
|
case 1:
|
|
AppHelper.Current.Theme = AppTheme.Dark;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ö÷Ìâ
|
|
/// </summary>
|
|
public static SerializableProperty<short> Theme { get; }
|
|
= new SerializableProperty<short>(GetKey(), Providers.Local, 1) { AutoSave = true };
|
|
|
|
/// <summary>
|
|
/// ÓïÑÔ
|
|
/// </summary>
|
|
public static SerializableProperty<string> Language { get; }
|
|
= new SerializableProperty<string>(GetKey(), Providers.Local, "") { AutoSave = true };
|
|
|
|
private static string GetKey([CallerMemberName] string propertyName = "")
|
|
{
|
|
return nameof(UISettings) + "." + propertyName;
|
|
}
|
|
}
|
|
}
|