schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Windows;
using System.Windows.Controls;
using XCommon.Log;
using XCore;
using XImagingXhandler.XDAL;
 
namespace XHandler.View.MethodProperty
{
    /// <summary>
    /// 超声探测页面
    /// </summary>
    public partial class UltrasonicProperty : System.Windows.Controls.UserControl
    {
        #region 变量
        private AspirateBll aspirateBll = new AspirateBll();
        private int mark = 0;
        public MethodUltrasonic methodUltrasonic = null;
        #endregion
 
        #region 构造函数
        public UltrasonicProperty(MethodEx method)
        {
            mark = 0;
            InitializeComponent();
 
            methodUltrasonic = new MethodUltrasonic();
            methodUltrasonic.name = method.method_name;
            methodUltrasonic.label = method.method_name;
            methodUltrasonic.status = (method.isEnabled == true ? "enable" : "disable");
            methodUltrasonic.strIndex = method.strIndex;
            this.DataContext = methodUltrasonic;
 
            if (method.tag != null)
            {
                methodUltrasonic = (MethodUltrasonic)method.tag;
            }
        }
        #endregion
 
        #region 页面初始化
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            mark += 1;
            try
            {
                if (mark > 1)
                {
                    return;
                }
 
                tbxCommandLabel.Text = methodUltrasonic.label;
                tbxCommandName.Text = methodUltrasonic.name;
 
                gridProperty.Children.Clear();
                UltrasonicChildProperty property = new UltrasonicChildProperty(methodUltrasonic.ultrasonicData);
                gridProperty.Children.Add(property);
            }
            catch (Exception ex)
            {
                LoggerHelper.ErrorLog("ERROR:", ex);
            }
        }
        #endregion
 
        #region 命令名称变更事件
        private void tbxCommandName_TextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                methodUltrasonic.name = tbxCommandName.Text;
                methodUltrasonic.label = tbxCommandLabel.Text;
            }
            catch (Exception ex)
            {
                LoggerHelper.ErrorLog("ERROR:", ex);
            }
        }
        #endregion
    }
}