VPet/VPet.Solution/Views/MainWindow.xaml.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2023-12-23 14:44:10 +00:00
using HKW.HKWUtils;
using Panuon.WPF.UI;
2023-12-30 14:54:49 +00:00
using System.ComponentModel;
using System.Windows;
2023-12-23 14:44:10 +00:00
using System.Windows.Controls;
using VPet.Solution.ViewModels;
2023-12-18 14:53:56 +00:00
2023-12-23 14:44:10 +00:00
namespace VPet.Solution.Views;
2023-12-18 14:53:56 +00:00
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : WindowX
{
2023-12-30 14:54:49 +00:00
public MainWindowVM ViewModel => (MainWindowVM)DataContext;
2023-12-23 14:44:10 +00:00
2023-12-18 14:53:56 +00:00
public MainWindow()
{
if (App.IsDone)
{
Close();
return;
}
InitializeComponent();
2023-12-30 14:54:49 +00:00
this.SetViewModel<MainWindowVM>();
ListBoxItem_GraphicsSettings.Tag = new GraphicsSettingPage();
ListBoxItem_SystemSettings.Tag = new SystemSettingPage();
ListBoxItem_InteractiveSettings.Tag = new InteractiveSettingPage();
ListBoxItem_CustomizedSettings.Tag = new CustomizedSettingPage();
ListBoxItem_DiagnosticSettings.Tag = new DiagnosticSettingPage();
ListBoxItem_ModSettings.Tag = new ModSettingPage();
2023-12-23 14:44:10 +00:00
}
private void Frame_Main_ContentRendered(object sender, EventArgs e)
{
if (sender is not Frame frame)
return;
// 清理过时页面
while (frame.CanGoBack)
frame.RemoveBackEntry();
GC.Collect();
2023-12-18 14:53:56 +00:00
}
}