VPet/VPet.Solution/ViewModels/SettingEditor/SystemSettingPageVM.cs

40 lines
1.0 KiB
C#
Raw Normal View History

2023-12-30 14:54:49 +00:00
using HKW.HKWUtils.Observable;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VPet.Solution.Models;
2024-01-07 14:57:27 +00:00
using VPet.Solution.Models.SettingEditor;
2023-12-30 14:54:49 +00:00
2024-01-07 14:57:27 +00:00
namespace VPet.Solution.ViewModels.SettingEditor;
2023-12-30 14:54:49 +00:00
public class SystemSettingPageVM : ObservableClass<SystemSettingPageVM>
{
2024-01-11 16:28:22 +00:00
#region SystemSetting
2023-12-30 14:54:49 +00:00
private SystemSettingModel _systemSetting;
public SystemSettingModel SystemSetting
{
get => _systemSetting;
set => SetProperty(ref _systemSetting, value);
}
2024-01-11 16:28:22 +00:00
#endregion
2023-12-30 14:54:49 +00:00
public SystemSettingPageVM()
{
2024-01-07 14:57:27 +00:00
SettingWindowVM.Current.PropertyChangedX += Current_PropertyChangedX;
2023-12-30 14:54:49 +00:00
}
2024-01-07 14:57:27 +00:00
private void Current_PropertyChangedX(SettingWindowVM sender, PropertyChangedXEventArgs e)
2023-12-30 14:54:49 +00:00
{
2024-01-11 16:28:22 +00:00
if (
e.PropertyName == nameof(SettingWindowVM.CurrentSetting)
&& sender.CurrentSetting is not null
)
2023-12-30 14:54:49 +00:00
{
SystemSetting = sender.CurrentSetting.SystemSetting;
}
}
}