HomepageForm.xaml.cs 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. using CollaborativePlatformMain.DFEntity;
  2. using CollaborativePlatformMain.Form.UserControlForm;
  3. using CollaborativePlatformMain.Util;
  4. using HandyControl.Controls;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Diagnostics.Eventing.Reader;
  9. using System.Drawing.Printing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows;
  14. using System.Windows.Controls;
  15. using System.Windows.Data;
  16. using System.Windows.Documents;
  17. using System.Windows.Input;
  18. using System.Windows.Media;
  19. using System.Windows.Media.Imaging;
  20. using System.Windows.Shapes;
  21. using Window = System.Windows.Window;
  22. using MessageBox = System.Windows.MessageBox;
  23. using static System.Net.Mime.MediaTypeNames;
  24. using CollaborativePlatformMain.Form.MessageSubPage;
  25. using CollaborativePlatformMain.Form.MessageSubPage.CreatLevel;
  26. using CollaborativePlatformMain.Form.MessageSubPage.Project;
  27. using CollaborativePlatformMain.DFEntity.MessageSubUtil;
  28. namespace CollaborativePlatformMain.Form
  29. {
  30. /// <summary>
  31. /// HomepageForm.xaml 的交互逻辑
  32. /// </summary>
  33. public partial class HomepageForm : Window
  34. {
  35. public HomepageForm()
  36. {
  37. InitializeComponent();
  38. }
  39. #region 最左边消息
  40. /// <summary>
  41. /// 消息是否为初始化
  42. /// </summary>
  43. public bool IsSeconMessagePage = false;
  44. /// <summary>
  45. /// 消息窗体
  46. /// </summary>
  47. public SeconMessagePage SeconMessagePage = null;
  48. /// <summary>
  49. /// 消息
  50. /// </summary>
  51. /// <param name="sender"></param>
  52. /// <param name="e"></param>
  53. private void message_Click(object sender, MouseButtonEventArgs e)
  54. {
  55. MenuItem menuItem = sender as MenuItem;
  56. ModifyBackground(menuItem);
  57. dp_message.Visibility = Visibility.Visible;
  58. dp_project.Visibility = Visibility.Collapsed;
  59. dp_contacts.Visibility = Visibility.Collapsed;
  60. dp_gallery.Visibility = Visibility.Collapsed;
  61. dp_tools.Visibility = Visibility.Collapsed;
  62. dp_threetools.Visibility = Visibility.Collapsed;
  63. dp_ArticleReview.Visibility = Visibility.Collapsed;
  64. SeconMessagePage = new SeconMessagePage(this);
  65. seconMessagePage.Navigate(SeconMessagePage);
  66. IsSeconMessagePage = true;
  67. //SwitchMethod(sender as MenuItem, true);
  68. }
  69. /// <summary>
  70. /// 项目是否初始化
  71. /// </summary>
  72. public bool IsSeconProjectPageShow = false;
  73. /// <summary>
  74. /// 项目
  75. /// </summary>
  76. /// <param name="sender"></param>
  77. /// <param name="e"></param>
  78. private void project_Click(object sender, MouseButtonEventArgs e)
  79. {
  80. MenuItem menuItem = sender as MenuItem;
  81. ModifyBackground(menuItem);
  82. dp_message.Visibility = Visibility.Collapsed;
  83. dp_project.Visibility = Visibility.Visible;
  84. dp_contacts.Visibility = Visibility.Collapsed;
  85. dp_gallery.Visibility = Visibility.Collapsed;
  86. dp_tools.Visibility = Visibility.Collapsed;
  87. dp_threetools.Visibility = Visibility.Collapsed;
  88. dp_ArticleReview.Visibility = Visibility.Collapsed;
  89. if (!IsSeconProjectPageShow)
  90. {
  91. seconProjectPage.Navigate(new SeconProjectPage(this));
  92. IsSeconProjectPageShow = true;
  93. }
  94. }
  95. /// <summary>
  96. /// 联系人是否初始化
  97. /// </summary>
  98. public bool IsSeconContactsPage = false;
  99. /// <summary>
  100. /// 联系人
  101. /// </summary>
  102. /// <param name="sender"></param>
  103. /// <param name="e"></param>
  104. private void contacts_Click(object sender, MouseButtonEventArgs e)
  105. {
  106. MenuItem menuItem = sender as MenuItem;
  107. ModifyBackground(menuItem);
  108. dp_message.Visibility = Visibility.Collapsed;
  109. dp_project.Visibility = Visibility.Collapsed;
  110. dp_contacts.Visibility = Visibility.Visible;
  111. dp_gallery.Visibility = Visibility.Visible;
  112. dp_tools.Visibility = Visibility.Collapsed;
  113. dp_threetools.Visibility = Visibility.Collapsed;
  114. dp_ArticleReview.Visibility = Visibility.Collapsed;
  115. if (!IsSeconContactsPage)
  116. {
  117. seconContactsPage.Navigate(new SeconContactsPage(this));
  118. IsSeconContactsPage = true;
  119. }
  120. }
  121. /// <summary>
  122. /// 图库大样图是否初始化
  123. /// </summary>
  124. public bool IsSeconLegendPage = false;
  125. /// <summary>
  126. /// 图库大样图
  127. /// </summary>
  128. /// <param name="sender"></param>
  129. /// <param name="e"></param>
  130. private void gallery_Click(object sender, MouseButtonEventArgs e)
  131. {
  132. MenuItem menuItem = sender as MenuItem;
  133. ModifyBackground(menuItem);
  134. dp_message.Visibility = Visibility.Collapsed;
  135. dp_project.Visibility = Visibility.Collapsed;
  136. dp_contacts.Visibility = Visibility.Collapsed;
  137. dp_gallery.Visibility = Visibility.Visible;
  138. dp_tools.Visibility = Visibility.Collapsed;
  139. dp_threetools.Visibility = Visibility.Collapsed;
  140. dp_ArticleReview.Visibility = Visibility.Collapsed;
  141. if (!IsSeconLegendPage)
  142. {
  143. seconLegendPage.Navigate(new SeconLegendPage(this));
  144. IsSeconLegendPage = true;
  145. }
  146. }
  147. /// <summary>
  148. /// 工具库是否初始化
  149. /// </summary>
  150. public bool IsSeconToolLibraryPage = false;
  151. /// <summary>
  152. /// 工具库
  153. /// </summary>
  154. /// <param name="sender"></param>
  155. /// <param name="e"></param>
  156. private void tool_Click(object sender, MouseButtonEventArgs e)
  157. {
  158. MenuItem menuItem = sender as MenuItem;
  159. ModifyBackground(menuItem);
  160. dp_message.Visibility = Visibility.Collapsed;
  161. dp_project.Visibility = Visibility.Collapsed;
  162. dp_contacts.Visibility = Visibility.Collapsed;
  163. dp_gallery.Visibility = Visibility.Collapsed;
  164. dp_tools.Visibility = Visibility.Visible;
  165. dp_threetools.Visibility = Visibility.Collapsed;
  166. dp_ArticleReview.Visibility = Visibility.Collapsed;
  167. if (!IsSeconToolLibraryPage)
  168. {
  169. seconToolsPage.Navigate(new SeconToolLibraryPage());
  170. IsSeconToolLibraryPage = true;
  171. }
  172. }
  173. /// <summary>
  174. /// 三维是否初始化
  175. /// </summary>
  176. public bool IsSeconThreeDimensionalPage = false;
  177. /// <summary>
  178. /// 三维
  179. /// </summary>
  180. /// <param name="sender"></param>
  181. /// <param name="e"></param>
  182. private void three_Click(object sender, MouseButtonEventArgs e)
  183. {
  184. MenuItem menuItem = sender as MenuItem;
  185. ModifyBackground(menuItem);
  186. dp_message.Visibility = Visibility.Collapsed;
  187. dp_project.Visibility = Visibility.Collapsed;
  188. dp_contacts.Visibility = Visibility.Collapsed;
  189. dp_gallery.Visibility = Visibility.Collapsed;
  190. dp_tools.Visibility = Visibility.Collapsed;
  191. dp_threetools.Visibility = Visibility.Visible;
  192. dp_ArticleReview.Visibility = Visibility.Collapsed;
  193. if (!IsSeconThreeDimensionalPage)
  194. {
  195. seconThreeTools.Navigate(new SeconThreeDimensionalPage(this));
  196. IsSeconThreeDimensionalPage = true;
  197. }
  198. }
  199. /// <summary>
  200. /// 条文审查是否初始化
  201. /// </summary>
  202. public bool IsSeconArticleReviewPage = false;
  203. /// <summary>
  204. /// 条文审查
  205. /// </summary>
  206. /// <param name="sender"></param>
  207. /// <param name="e"></param>
  208. private void MenuItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  209. {
  210. MenuItem menuItem = sender as MenuItem;
  211. ModifyBackground(menuItem);
  212. dp_message.Visibility = Visibility.Collapsed;
  213. dp_project.Visibility = Visibility.Collapsed;
  214. dp_contacts.Visibility = Visibility.Collapsed;
  215. dp_gallery.Visibility = Visibility.Collapsed;
  216. dp_tools.Visibility = Visibility.Collapsed;
  217. dp_threetools.Visibility = Visibility.Collapsed;
  218. dp_ArticleReview.Visibility = Visibility.Visible;
  219. if (!IsSeconArticleReviewPage)
  220. {
  221. seconArticleReview.Navigate(new SeconArticleReviewPage());
  222. IsSeconArticleReviewPage = true;
  223. }
  224. }
  225. /// <summary>
  226. /// 设置最左测导航的颜色
  227. /// </summary>
  228. /// <param name="menuItem"></param>
  229. /// <param name="isHoShow"></param>
  230. public void ModifyBackground(MenuItem menuItem)
  231. {
  232. List<MenuItem> allMenuItems = CollaborationUtil.GetChildObjects<System.Windows.Controls.MenuItem>(mu_leftMenu);
  233. foreach (var baseMenuItem in allMenuItems)
  234. {
  235. if (baseMenuItem.Header.ToString() == menuItem.Header.ToString())
  236. {
  237. baseMenuItem.Background = new SolidColorBrush(Colors.Beige);
  238. }
  239. else
  240. {
  241. baseMenuItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1E9FFF"));
  242. }
  243. }
  244. }
  245. #endregion
  246. /// <summary>
  247. /// 青蓝小助手
  248. /// </summary>
  249. /// <param name="sender"></param>
  250. /// <param name="e"></param>
  251. private void bt_qlxzs_Click(object sender, RoutedEventArgs e)
  252. {
  253. this.Visibility = Visibility.Collapsed;
  254. StandardizedAssistantForm assistantForm = new StandardizedAssistantForm(this);
  255. assistantForm.Show();
  256. }
  257. }
  258. }