VPet/VPet.Solution/ViewModels/SettingEditor/SystemSettingPageVM.cs
2024-01-12 00:28:22 +08:00

40 lines
1.0 KiB
C#

using HKW.HKWUtils.Observable;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VPet.Solution.Models;
using VPet.Solution.Models.SettingEditor;
namespace VPet.Solution.ViewModels.SettingEditor;
public class SystemSettingPageVM : ObservableClass<SystemSettingPageVM>
{
#region SystemSetting
private SystemSettingModel _systemSetting;
public SystemSettingModel SystemSetting
{
get => _systemSetting;
set => SetProperty(ref _systemSetting, value);
}
#endregion
public SystemSettingPageVM()
{
SettingWindowVM.Current.PropertyChangedX += Current_PropertyChangedX;
}
private void Current_PropertyChangedX(SettingWindowVM sender, PropertyChangedXEventArgs e)
{
if (
e.PropertyName == nameof(SettingWindowVM.CurrentSetting)
&& sender.CurrentSetting is not null
)
{
SystemSetting = sender.CurrentSetting.SystemSetting;
}
}
}