2024-01-25 13:56:38 +00:00
|
|
|
|
using HKW.HKWUtils.Observable;
|
|
|
|
|
using LinePutScript.Localization.WPF;
|
|
|
|
|
using Panuon.WPF.UI;
|
|
|
|
|
using System;
|
2023-12-18 14:53:56 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace VPet.Solution.ViewModels;
|
|
|
|
|
|
2024-01-25 13:56:38 +00:00
|
|
|
|
public class MainWindowVM : ObservableClass<MainWindowVM>
|
|
|
|
|
{
|
|
|
|
|
public MainWindowVM()
|
|
|
|
|
{
|
|
|
|
|
LocalizeCore.StoreTranslation = true;
|
|
|
|
|
LocalizeCore.LoadDefaultCulture();
|
|
|
|
|
CurrentCulture = LocalizeCore.CurrentCulture;
|
|
|
|
|
FirstStartFailedCommand.ExecuteCommand += FirstStartFailedCommand_ExecuteCommand;
|
|
|
|
|
OpenLocalTextCommand.ExecuteCommand += OpenLocalTextCommand_ExecuteCommand;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OpenLocalTextCommand_ExecuteCommand()
|
|
|
|
|
{
|
|
|
|
|
var sb = new StringBuilder();
|
|
|
|
|
foreach (var a in LocalizeCore.StoreTranslationList)
|
|
|
|
|
sb.AppendLine(a.Replace("\r\n", "\\r\\n"));
|
|
|
|
|
MessageBoxX.Show(sb.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FirstStartFailedCommand_ExecuteCommand()
|
|
|
|
|
{
|
|
|
|
|
Utils.OpenLink(
|
|
|
|
|
"https://steamcommunity.com/games/1920960/announcements/detail/3681184905256253203"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region Property
|
|
|
|
|
public IEnumerable<string> AvailableCultures => LocalizeCore.AvailableCultures;
|
|
|
|
|
#region CurrentCulture
|
|
|
|
|
private string _currentCulture = string.Empty;
|
|
|
|
|
public string CurrentCulture
|
|
|
|
|
{
|
|
|
|
|
get => _currentCulture;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
SetProperty(ref _currentCulture, value);
|
|
|
|
|
LocalizeCore.LoadCulture(_currentCulture);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Command
|
|
|
|
|
public ObservableCommand FirstStartFailedCommand { get; } = new();
|
|
|
|
|
public ObservableCommand OpenLocalTextCommand { get; } = new();
|
|
|
|
|
#endregion
|
|
|
|
|
}
|