mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-24 02:39:46 +08:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using ReactiveUI;
|
|
using System.Application.Models.Settings;
|
|
using System.Application.UI.Resx;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace System.Application.UI.ViewModels
|
|
{
|
|
public class SettingsPageViewModel : TabItemViewModel
|
|
{
|
|
public static SettingsPageViewModel Instance { get; } = new SettingsPageViewModel();
|
|
|
|
public override string Name
|
|
{
|
|
get => AppResources.Settings;
|
|
protected set { throw new NotImplementedException(); }
|
|
}
|
|
|
|
KeyValuePair<string, string> _SelectLanguage;
|
|
public KeyValuePair<string, string> SelectLanguage
|
|
{
|
|
get => _SelectLanguage;
|
|
protected set => this.RaiseAndSetIfChanged(ref _SelectLanguage, value);
|
|
}
|
|
|
|
public SettingsPageViewModel()
|
|
{
|
|
SelectLanguage = R.Languages.SingleOrDefault(x => x.Key == UISettings.Language.Value);
|
|
this.WhenAnyValue(x => x.SelectLanguage)
|
|
.Subscribe(x => UISettings.Language.Value = x.Key);
|
|
}
|
|
}
|
|
} |