alielie
2026-06-15 f08871fe7d148d667f2f11f80f64de71a0d9504c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using HMI.AlarmInfoManage.Entity;
using HMI.Core.Api;
using HMI.Core.Util;
using System.Windows;
using System.Windows.Controls;
 
namespace HMI.AlarmInfoManage
{
    /// <summary>
    /// AlarmInfoManage_Setting.xaml 的交互逻辑
    /// </summary>
    public partial class AlarmInfoManage_SettingA : UserControl, IConfigManager
    {
        public AlarmInfoManage_SettingA()
        {
            InitializeComponent();
        }
 
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            ResetConfig();
        }
 
        public object GetConfig()
        {
            return AimSetting.Instance;
        }
 
        public void SaveConfig()
        {
            AimSettingModel model = (AimSettingModel)DataContext;
 
            AimSetting newSetting = AimSetting.FromModel(model);
 
            XmlHelper.SerializeToXml(PathHelper.ConfigFolder + "\\AimSetting.xml", model);
        }
 
        public void ResetConfig()
        {
            DataContext = AimSetting.Instance.GetModel();
        }
    }
}