TempPage.xaml.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using CollaborativePlatformMain.DFEntity.MessageSubUtil;
  2. using CollaborativePlatformMain.Form.UserControlForm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Shapes;
  17. namespace CollaborativePlatformMain.Form.MessageSubPage.Project
  18. {
  19. /// <summary>
  20. /// TempPage.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class TempPage : Page
  23. {
  24. public List<NativeDataInfo> ArchUserDatas = new List<NativeDataInfo>();
  25. public List<NativeDataInfo> StruUserDatas = new List<NativeDataInfo>();
  26. public List<NativeDataInfo> WaterUserDatas = new List<NativeDataInfo>();
  27. public List<NativeDataInfo> WarmUserDatas = new List<NativeDataInfo>();
  28. public List<NativeDataInfo> EleUserDatas = new List<NativeDataInfo>();
  29. public TempPage()
  30. {
  31. InitializeComponent();
  32. }
  33. /// <summary>
  34. /// 窗体初始化
  35. /// </summary>
  36. /// <param name="sender"></param>
  37. /// <param name="e"></param>
  38. private void Page_Loaded(object sender, RoutedEventArgs e)
  39. {
  40. ArchUserDatas = new List<NativeDataInfo>();
  41. StruUserDatas = new List<NativeDataInfo>();
  42. WaterUserDatas = new List<NativeDataInfo>();
  43. WarmUserDatas = new List<NativeDataInfo>();
  44. EleUserDatas = new List<NativeDataInfo>();
  45. ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
  46. ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
  47. ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
  48. ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
  49. ArchUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
  50. StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
  51. StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
  52. StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
  53. StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
  54. StruUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
  55. WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
  56. WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
  57. WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
  58. WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
  59. WaterUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
  60. WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
  61. WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
  62. WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
  63. WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
  64. WarmUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
  65. EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
  66. EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
  67. EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
  68. EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
  69. EleUserDatas.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
  70. cb_arch.ItemsSource = ArchUserDatas;
  71. cb_stru.ItemsSource = StruUserDatas;
  72. cb_water.ItemsSource = WaterUserDatas;
  73. cb_warm.ItemsSource = WarmUserDatas;
  74. cb_ele.ItemsSource = EleUserDatas;
  75. }
  76. /// <summary>
  77. /// 添加专业成员
  78. /// </summary>
  79. /// <param name="sender"></param>
  80. /// <param name="e"></param>
  81. private void bt_add_Click(object sender, RoutedEventArgs e)
  82. {
  83. string addValue = tb_add.Text.ToString();
  84. if (addValue == null || addValue == "") return;
  85. Label label = new Label();
  86. label.Content = addValue;
  87. label.Width = 80;
  88. //label.Background= new SolidColorBrush((Color)ColorConverter.ConvertFromString("#eee"));
  89. NativeCombox nativeCombox = new NativeCombox();
  90. List<NativeDataInfo> nativeDataInfos = new List<NativeDataInfo>();
  91. nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计1"));
  92. nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计2"));
  93. nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计3"));
  94. nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计4"));
  95. nativeDataInfos.Add(new NativeDataInfo(Guid.NewGuid().ToString(), "伙计5"));
  96. nativeCombox.ItemsSource = nativeDataInfos;
  97. nativeCombox.Width = 200;
  98. nativeCombox.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#eee"));
  99. nativeCombox.HorizontalAlignment = HorizontalAlignment.Left;
  100. DockPanel dockPanel = new DockPanel();
  101. dockPanel.Children.Add(label);
  102. dockPanel.Children.Add(nativeCombox);
  103. dockPanel.Margin = new Thickness(0, 5, 0, 0);
  104. sp_temps.Children.Add(dockPanel);
  105. tb_add.Text = "";
  106. }
  107. }
  108. }