VPet/VPet.Solution/Views/MainWindow.xaml.cs
Hakoyu e44a649c57 # VPet.Solution
## 更新
- 修改主界面文化时会同步修改`Setting.lps`的文化设置
- 修改设置编辑页面的设置列表排序
## 修复
- 存在两个相同名称的mod时启动失败的问题
- `设置编辑`-`图像`页面语言列表显示错误的问题
2024-02-04 00:08:31 +08:00

54 lines
1.3 KiB
C#

using HKW.HKWUtils;
using LinePutScript.Localization.WPF;
using Panuon.WPF.UI;
using System.ComponentModel;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using VPet.Solution.Models.SettingEditor;
using VPet.Solution.ViewModels;
using VPet.Solution.Views.SaveViewer;
using VPet.Solution.Views.SettingEditor;
using VPet_Simulator.Windows.Interface;
namespace VPet.Solution.Views;
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : WindowX
{
public MainWindowVM ViewModel => (MainWindowVM)DataContext;
public SettingWindow SettingWindow { get; } = new();
public SaveWindow SaveWindow { get; } = new();
public MainWindow()
{
if (App.IsDone)
{
Close();
return;
}
InitializeComponent();
this.SetViewModel<MainWindowVM>();
Closed += MainWindow_Closed;
}
private void MainWindow_Closed(object sender, EventArgs e)
{
SettingWindow.CloseX();
SaveWindow.CloseX();
}
private void Button_OpenSettingEditor_Click(object sender, RoutedEventArgs e)
{
SettingWindow.ShowOrActivate();
}
private void Button_OpenSaveViewer_Click(object sender, RoutedEventArgs e)
{
SaveWindow.ShowOrActivate();
}
}