Blame view

OS.Spin/OS.Spin.View/SquareBox/UserControl2.xaml.cs 2.86 KB
8ca6e89d   Tuo Wenbo   20211021
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
  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>
      /// UserControl2.xaml 的交互逻辑
      /// </summary>
      public partial class UserControl2 : UserControl
      {
          public UserControl2()
          {
              InitializeComponent();
          }
  
          OS.Spin.View.Utils.SquareBoxUtils squareBoxUtils = OS.Spin.View.Utils.SquareBoxUtils.getInstance();
  
          private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
          {
              try
              {
                  //MessageBox.Show("这里是UserControl2~~start");
                  OS.Spin.View.SquareBox.UserControl2 userControl2 = (OS.Spin.View.SquareBox.UserControl2)sender;
                  //只能先删除瑕疵点
                  squareBoxUtils.removeDefectShowDatas(userControl2);
                  //通知更新瑕疵点显示界面(我这里只负责通知就行了,至于怎么显示不管)(同步更新)
                  DefectShowDelegateUtil defectShowDelegateUtil = squareBoxUtils.getDefectShowDelegateUtil();
                  List<OS.Spin.ViewModle.Models.DefectShowData> defectShowDatas = squareBoxUtils.getDefectShowDatas();
                  defectShowDelegateUtil.defectShowDelegate(defectShowDatas);
  
                  //删除完瑕疵点后才能删除显示的照片
                  squareBoxUtils.removeUserControlFathers(userControl2);
                  //获取最新的数据,并更新到界面最新的状态
                  //SquareBoxDelegateUtil squareBoxDelegateUtil = squareBoxUtils.getSquareBoxDelegateUtil();
                  //List<ControlUserOne> controlUserOnes = squareBoxUtils.getUserControlFathers();
                  //squareBoxDelegateUtil.squareBoxDelegate(controlUserOnes);   //执行注册委托里的函数
              }
              catch (Exception ex)
              {
                  LogisTrac.WriteLog(string.Format("UserControl_MouseDown:{0}", ex.Message));
              }
              //MessageBox.Show("这里是UserControl2~~end");
  
          }
          //从集合中移除
          //private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
          //{
          //    MessageBox.Show("点击我从界面移除");
          //    CodeTable.Commands.SquareBox.UserControl2 userControl2 = (CodeTable.Commands.SquareBox.UserControl2)sender;
  
          //    squareBoxUtils.removeUserControlFathers(userControl2);
  
          //    //获取最新的数据,并更新到界面最新的状态
          //    SquareBoxDelegateUtil squareBoxDelegateUtil = squareBoxUtils.getSquareBoxDelegateUtil();
          //    List<CodeTable.Models.ControlUserOne> controlUserOnes = squareBoxUtils.getUserControlFathers();
          //    squareBoxDelegateUtil.squareBoxDelegate(controlUserOnes);   //执行注册委托里的函数
  
          //}
      }
  }