终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

TechnologyProcess.xaml.cs 2.5 KiB

2 yıl önce
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using BPASmartClient.Helper;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. namespace BPASmart.RecipeManagement.View
  16. {
  17. /// <summary>
  18. /// TechnologyProcess.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class TechnologyProcess : Window
  21. {
  22. public TechnologyProcess()
  23. {
  24. InitializeComponent();
  25. this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
  26. ActionManage.GetInstance.CancelRegister("CloseTechnologyProcessView");
  27. ActionManage.GetInstance.Register(new Action(() =>
  28. {
  29. this.Close();
  30. }), "CloseTechnologyProcessView");
  31. }
  32. private void Label_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  33. {
  34. Label txt = sender as Label;
  35. if (txt != null)
  36. {
  37. StackPanel oldSp = FindFirstVisualChild(itemcontrols, "stk");
  38. if (oldSp != null)
  39. oldSp.Background = new SolidColorBrush(Color.FromRgb(38, 76, 115));
  40. StackPanel sp = VisualTreeHelper.GetParent(txt) as StackPanel;
  41. sp.Background = new SolidColorBrush(Color.FromRgb(8, 20, 36));
  42. ActionManage.GetInstance.Send("CurrentItemId", txt.Content);
  43. }
  44. }
  45. public StackPanel FindFirstVisualChild(DependencyObject obj, string childName)
  46. {
  47. for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
  48. {
  49. DependencyObject child = VisualTreeHelper.GetChild(obj, i);
  50. if (child != null && child is StackPanel && child.GetValue(NameProperty).ToString() == childName)
  51. {
  52. if (child is StackPanel stack && stack.Background?.ToString() == "#FF081424")
  53. return stack;
  54. }
  55. else
  56. {
  57. StackPanel SP = FindFirstVisualChild(child, childName);
  58. if (SP != null)
  59. {
  60. return SP;
  61. }
  62. }
  63. }
  64. return null;
  65. }
  66. }
  67. }