mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-21 09:45:48 +08:00
Load and save config
This commit is contained in:
@@ -17,14 +17,18 @@ using System.Collections.ObjectModel;
|
||||
using BetterGenshinImpact.View.Pages;
|
||||
using Wpf.Ui;
|
||||
using Wpf.Ui.Controls;
|
||||
using BetterGenshinImpact.Service.Interface;
|
||||
using BetterGenshinImpact.Service;
|
||||
|
||||
namespace BetterGenshinImpact.ViewModel
|
||||
{
|
||||
public partial class MainWindowViewModel : ObservableObject
|
||||
{
|
||||
public MainWindowViewModel(INavigationService navigationService)
|
||||
{
|
||||
private readonly IConfigService _configService;
|
||||
|
||||
public MainWindowViewModel(INavigationService navigationService, IConfigService configService)
|
||||
{
|
||||
_configService = configService;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +41,7 @@ namespace BetterGenshinImpact.ViewModel
|
||||
[RelayCommand]
|
||||
private void OnClosed()
|
||||
{
|
||||
_configService.Save();
|
||||
WeakReferenceMessenger.Default.Send(new PropertyChangedMessage<object>(this, "Close", "", ""));
|
||||
Debug.WriteLine("MainWindowViewModel Closed");
|
||||
Application.Current.Shutdown();
|
||||
|
||||
Reference in New Issue
Block a user