UserControl4.xaml.cs
2.78 KB
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
using System;
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows.Input;
using OS.Spin.View.Utils;
using OS.Spin.Common;
namespace OS.Spin.View.SquareBox
{
/// <summary>
/// UserControl4.xaml 的交互逻辑
/// </summary>
public partial class UserControl4 : UserControl
{
public UserControl4()
{
InitializeComponent();
}
public Image Image
{
get { return logo; }
set
{
logo = value;
}
}
public Canvas Canvas
{
get { return canvas4; }
}
SquareBoxUtils squareBox = SquareBoxUtils.getInstance();
/// <summary>
///1、 除了将自身设置为1,自身以外的设置为0以外
///2、 找到该点击对应哪个瑕疵点,然后改变它的状态,并且通知委托重新加载它的显示界面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
{
try
{
//MessageBox.Show("这里是UserControl4");
OS.Spin.View.SquareBox.UserControl4 userControl4 = (OS.Spin.View.SquareBox.UserControl4)sender;
squareBox.updateUserControlFathers(userControl4); //只要点击了就将其状态重置为1,其它的都设置为0
//获取最新的数据,并更新到界面最新的状态
//SquareBoxDelegateUtil squareBoxDelegateUtil = squareBox.getSquareBoxDelegateUtil();
//List<ControlUserOne> controlUserOnes = squareBox.getUserControlFathers();
//squareBoxDelegateUtil.squareBoxDelegate(controlUserOnes); //执行注册委托里的函数
/****************************************************************************/
SquareBoxDefectDelegateUtil squareBoxDefectDelegateUtil = squareBox.getSquareBoxDefectDelegateUtil();
List<ControlUserOne> controlUserOnes = squareBox.getUserControlFathers();
squareBoxDefectDelegateUtil.squareBoxDefectDelegate(controlUserOnes);
//通知更新瑕疵点显示界面(我这里只负责通知就行了,至于怎么显示不管)
DefectShowDelegateUtil defectShowDelegateUtil = squareBox.getDefectShowDelegateUtil();
List<OS.Spin.ViewModle.Models.DefectShowData> defectShowDatas = squareBox.getDefectShowDatas();
defectShowDelegateUtil.defectShowDelegate(defectShowDatas);
}
catch (Exception ex)
{
LogisTrac.WriteLog(string.Format("UserControl_MouseDown:{0}", ex.Message));
}
}
}
}