RightCardControl.xaml.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. using DraggAnimatedPanelExample;
  2. using GeekDesk.Constant;
  3. using GeekDesk.Control.Other;
  4. using GeekDesk.Control.Windows;
  5. using GeekDesk.Util;
  6. using GeekDesk.ViewModel;
  7. using HandyControl.Controls;
  8. using System;
  9. using System.Collections.ObjectModel;
  10. using System.Diagnostics;
  11. using System.IO;
  12. using System.Threading;
  13. using System.Windows;
  14. using System.Windows.Controls;
  15. using System.Windows.Input;
  16. using System.Windows.Media.Animation;
  17. using System.Windows.Threading;
  18. namespace GeekDesk.Control.UserControls.PannelCard
  19. {
  20. /// <summary>
  21. /// RightCardControl.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class RightCardControl : UserControl
  24. {
  25. private AppData appData = MainWindow.appData;
  26. ListBoxDragDropManager<IconInfo> dragMgr;
  27. //private Thread dropCheckThread = null;
  28. public RightCardControl()
  29. {
  30. InitializeComponent();
  31. this.Loaded += RightCardControl_Loaded;
  32. }
  33. private void RightCardControl_Loaded(object sender, RoutedEventArgs e)
  34. {
  35. this.dragMgr = new ListBoxDragDropManager<IconInfo>(this.IconListBox);
  36. }
  37. //#region 图标拖动
  38. //DelegateCommand<int[]> _swap;
  39. //public DelegateCommand<int[]> SwapCommand
  40. //{
  41. // get
  42. // {
  43. // if (_swap == null)
  44. // _swap = new DelegateCommand<int[]>(
  45. // (indexes) =>
  46. // {
  47. // DROP_ICON = true;
  48. // if (appData.AppConfig.IconSortType != SortType.CUSTOM
  49. // && (dropCheckThread == null || !dropCheckThread.IsAlive))
  50. // {
  51. // dropCheckThread = new Thread(() =>
  52. // {
  53. // do
  54. // {
  55. // DROP_ICON = false;
  56. // Thread.Sleep(1000);
  57. // } while (DROP_ICON);
  58. // MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
  59. // App.Current.Dispatcher.Invoke(() =>
  60. // {
  61. // if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
  62. // || MainWindow.mainWindow.Opacity != 1)
  63. // {
  64. // Growl.WarningGlobal("已将图标排序规则重置为自定义!");
  65. // }
  66. // else
  67. // {
  68. // Growl.Warning("已将图标排序规则重置为自定义!", "MainWindowGrowl");
  69. // }
  70. // });
  71. // });
  72. // dropCheckThread.Start();
  73. // }
  74. // int fromS = indexes[0];
  75. // int to = indexes[1];
  76. // ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
  77. // var elementSource = iconList[to];
  78. // var dragged = iconList[fromS];
  79. // iconList.Remove(dragged);
  80. // iconList.Insert(to, dragged);
  81. // }
  82. // );
  83. // return _swap;
  84. // }
  85. //}
  86. //#endregion 图标拖动
  87. private void Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  88. {
  89. if (appData.AppConfig.DoubleOpen)
  90. {
  91. IconClick(sender, e);
  92. }
  93. }
  94. private void Icon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  95. {
  96. if (!appData.AppConfig.DoubleOpen)
  97. {
  98. IconClick(sender, e);
  99. }
  100. }
  101. /// <summary>
  102. /// 图标点击事件
  103. /// </summary>
  104. /// <param name="sender"></param>
  105. /// <param name="e"></param>
  106. private void IconClick(object sender, MouseButtonEventArgs e)
  107. {
  108. if (appData.AppConfig.DoubleOpen && e.ClickCount >= 2)
  109. {
  110. IconInfo icon = (IconInfo)((Panel)sender).Tag;
  111. if (icon.AdminStartUp)
  112. {
  113. StartIconApp(icon, IconStartType.ADMIN_STARTUP);
  114. }
  115. else
  116. {
  117. StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
  118. }
  119. }
  120. else if (!appData.AppConfig.DoubleOpen && e.ClickCount == 1)
  121. {
  122. IconInfo icon = (IconInfo)((Panel)sender).Tag;
  123. if (icon.AdminStartUp)
  124. {
  125. StartIconApp(icon, IconStartType.ADMIN_STARTUP);
  126. }
  127. else
  128. {
  129. StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
  130. }
  131. }
  132. }
  133. /// <summary>
  134. /// 管理员方式启动
  135. /// </summary>
  136. /// <param name="sender"></param>
  137. /// <param name="e"></param>
  138. private void IconAdminStart(object sender, RoutedEventArgs e)
  139. {
  140. IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
  141. StartIconApp(icon, IconStartType.ADMIN_STARTUP);
  142. }
  143. /// <summary>
  144. /// 打开文件所在位置
  145. /// </summary>
  146. /// <param name="sender"></param>
  147. /// <param name="e"></param>
  148. private void ShowInExplore(object sender, RoutedEventArgs e)
  149. {
  150. IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
  151. StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
  152. }
  153. private void StartIconApp(IconInfo icon, IconStartType type)
  154. {
  155. try
  156. {
  157. using (Process p = new Process())
  158. {
  159. string startArg = icon.StartArg;
  160. if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg))
  161. {
  162. StartSystemApp(startArg, type);
  163. }
  164. else
  165. {
  166. p.StartInfo.FileName = icon.Path;
  167. if (!StringUtil.IsEmpty(startArg))
  168. {
  169. p.StartInfo.Arguments = startArg;
  170. }
  171. if (icon.IconType == IconType.OTHER)
  172. {
  173. if (!File.Exists(icon.Path) && !Directory.Exists(icon.Path))
  174. {
  175. HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
  176. return;
  177. }
  178. p.StartInfo.WorkingDirectory = icon.Path.Substring(0, icon.Path.LastIndexOf("\\"));
  179. switch (type)
  180. {
  181. case IconStartType.ADMIN_STARTUP:
  182. //p.StartInfo.Arguments = "1";//启动参数
  183. p.StartInfo.Verb = "runas";
  184. //p.StartInfo.CreateNoWindow = false; //设置显示窗口
  185. p.StartInfo.UseShellExecute = true;//不使用操作系统外壳程序启动进程
  186. //p.StartInfo.ErrorDialog = false;
  187. if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
  188. {
  189. //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
  190. if (appData.AppConfig.MarginHide)
  191. {
  192. if (!MarginHide.IsMargin())
  193. {
  194. MainWindow.HideApp();
  195. }
  196. }
  197. else
  198. {
  199. MainWindow.HideApp();
  200. }
  201. }
  202. break;// c#好像不能case穿透
  203. case IconStartType.DEFAULT_STARTUP:
  204. if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
  205. {
  206. //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
  207. if (appData.AppConfig.MarginHide)
  208. {
  209. if (!MarginHide.IsMargin())
  210. {
  211. MainWindow.HideApp();
  212. }
  213. }
  214. else
  215. {
  216. MainWindow.HideApp();
  217. }
  218. }
  219. break;
  220. case IconStartType.SHOW_IN_EXPLORE:
  221. p.StartInfo.FileName = "Explorer.exe";
  222. p.StartInfo.Arguments = "/e,/select," + icon.Path;
  223. break;
  224. }
  225. }
  226. else
  227. {
  228. if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
  229. {
  230. //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
  231. if (appData.AppConfig.MarginHide)
  232. {
  233. if (!MarginHide.IS_HIDE)
  234. {
  235. MainWindow.HideApp();
  236. }
  237. }
  238. else
  239. {
  240. MainWindow.HideApp();
  241. }
  242. }
  243. }
  244. p.Start();
  245. }
  246. }
  247. icon.Count++;
  248. //隐藏搜索框
  249. if (RunTimeStatus.SEARCH_BOX_SHOW)
  250. {
  251. MainWindow.mainWindow.HidedSearchBox();
  252. }
  253. }
  254. catch (Exception e)
  255. {
  256. HandyControl.Controls.Growl.WarningGlobal("程序启动失败(不支持的启动方式)!");
  257. LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type);
  258. }
  259. }
  260. private void StartSystemApp(string startArg, IconStartType type)
  261. {
  262. if (type == IconStartType.SHOW_IN_EXPLORE)
  263. {
  264. Growl.WarningGlobal("系统项目不支持打开文件位置操作!");
  265. return;
  266. }
  267. switch (startArg)
  268. {
  269. case "Calculator":
  270. Process.Start("calc.exe");
  271. break;
  272. case "Computer":
  273. Process.Start("explorer.exe");
  274. break;
  275. case "GroupPolicy":
  276. Process.Start("gpedit.msc");
  277. break;
  278. case "Notepad":
  279. Process.Start("notepad");
  280. break;
  281. case "Network":
  282. Process.Start("ncpa.cpl");
  283. break;
  284. case "RecycleBin":
  285. Process.Start("shell:RecycleBinFolder");
  286. break;
  287. case "Registry":
  288. Process.Start("regedit.exe");
  289. break;
  290. case "Mstsc":
  291. if (type == IconStartType.ADMIN_STARTUP)
  292. {
  293. Process.Start("mstsc", "-admin");
  294. }
  295. else
  296. {
  297. Process.Start("mstsc");
  298. }
  299. break;
  300. case "Control":
  301. Process.Start("Control");
  302. break;
  303. case "CMD":
  304. if (type == IconStartType.ADMIN_STARTUP)
  305. {
  306. using (Process process = new Process())
  307. {
  308. process.StartInfo.FileName = "cmd.exe";
  309. process.StartInfo.Verb = "runas";
  310. process.Start();
  311. }
  312. }
  313. else
  314. {
  315. Process.Start("cmd");
  316. }
  317. break;
  318. case "Services":
  319. Process.Start("services.msc");
  320. break;
  321. }
  322. //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
  323. if (appData.AppConfig.MarginHide)
  324. {
  325. if (!MarginHide.IS_HIDE)
  326. {
  327. MainWindow.HideApp();
  328. }
  329. }
  330. else
  331. {
  332. MainWindow.HideApp();
  333. }
  334. }
  335. /// <summary>
  336. /// 拖动添加项目
  337. /// </summary>
  338. /// <param name="sender"></param>
  339. /// <param name="e"></param>
  340. private void Wrap_Drop(object sender, DragEventArgs e)
  341. {
  342. Array dropObject = (System.Array)e.Data.GetData(DataFormats.FileDrop);
  343. if (dropObject == null) return;
  344. foreach (object obj in dropObject)
  345. {
  346. string path = (string)obj;
  347. IconInfo iconInfo = CommonCode.GetIconInfoByPath(path);
  348. MainWindow.appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Add(iconInfo);
  349. }
  350. CommonCode.SortIconList();
  351. CommonCode.SaveAppData(MainWindow.appData);
  352. }
  353. /// <summary>
  354. /// 从列表删除图标
  355. /// </summary>
  356. /// <param name="sender"></param>
  357. /// <param name="e"></param>
  358. private void RemoveIcon(object sender, RoutedEventArgs e)
  359. {
  360. appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Remove((IconInfo)((MenuItem)sender).Tag);
  361. }
  362. private void SystemContextMenu(object sender, RoutedEventArgs e)
  363. {
  364. IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
  365. DirectoryInfo[] folders = new DirectoryInfo[1];
  366. folders[0] = new DirectoryInfo(icon.Path);
  367. ShellContextMenu scm = new ShellContextMenu();
  368. System.Drawing.Point p = System.Windows.Forms.Cursor.Position;
  369. p.X -= 80;
  370. p.Y -= 80;
  371. scm.ShowContextMenu(folders, p);
  372. }
  373. /// <summary>
  374. /// 弹出Icon属性修改面板
  375. /// </summary>
  376. /// <param name="sender"></param>
  377. /// <param name="e"></param>
  378. private void PropertyConfig(object sender, RoutedEventArgs e)
  379. {
  380. IconInfo info = (IconInfo)((MenuItem)sender).Tag;
  381. switch (info.IconType)
  382. {
  383. case IconType.URL:
  384. IconInfoUrlDialog urlDialog = new IconInfoUrlDialog(info);
  385. urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "IconInfoDialog");
  386. break;
  387. default:
  388. IconInfoDialog dialog = new IconInfoDialog(info);
  389. dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "IconInfoDialog");
  390. break;
  391. }
  392. }
  393. private void StackPanel_MouseEnter(object sender, MouseEventArgs e)
  394. {
  395. double width = appData.AppConfig.ImageWidth;
  396. double height = appData.AppConfig.ImageHeight;
  397. width += width * 0.15;
  398. height += height * 0.15;
  399. Thread t = new Thread(() =>
  400. {
  401. this.Dispatcher.BeginInvoke(new Action(() =>
  402. {
  403. ImgStoryBoard(sender, (int)width, (int)height, 1, true);
  404. }));
  405. });
  406. t.IsBackground = true;
  407. t.Start();
  408. }
  409. private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
  410. {
  411. Thread t = new Thread(() =>
  412. {
  413. this.Dispatcher.BeginInvoke(new Action(() =>
  414. {
  415. ImgStoryBoard(sender, appData.AppConfig.ImageWidth, appData.AppConfig.ImageHeight, 260);
  416. }));
  417. });
  418. t.IsBackground = true;
  419. t.Start();
  420. }
  421. private void ImgStoryBoard(object sender, int height, int width, int milliseconds, bool checkRmStoryboard = false)
  422. {
  423. if (appData.AppConfig.PMModel) return;
  424. //int count = 0;
  425. //Panel sp = sender as Panel;
  426. //Image img = sp.Children[0] as Image;
  427. //int nowH = (int)img.Height;
  428. //bool isSmall = nowH > height;
  429. //if (!isSmall)
  430. //{
  431. // img.Height = height;
  432. // img.Width = width;
  433. // return;
  434. //}
  435. //double subLen = (double)Math.Abs(nowH - height) / (double)milliseconds;
  436. //new Thread(() =>
  437. //{
  438. // this.Dispatcher.Invoke(() =>
  439. // {
  440. // while (count < milliseconds)
  441. // {
  442. // if (!isSmall)
  443. // {
  444. // img.Height += subLen;
  445. // img.Width += subLen;
  446. // } else
  447. // {
  448. // //if (img.Height > 1)
  449. // //{
  450. // // img.Height -= 1;
  451. // // img.Width -= 1;
  452. // //}
  453. // Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
  454. // new Action(delegate {
  455. // img.Height -= subLen;
  456. // img.Width -= subLen;
  457. // }));
  458. // //img.Height -= subLen;
  459. // //img.Width -= subLen;
  460. // }
  461. // count++;
  462. // Thread.Sleep(1);
  463. // }
  464. // img.Height = height;
  465. // img.Width = width;
  466. // });
  467. //}).Start();
  468. Panel sp = sender as Panel;
  469. DependencyObject dos = sp.Parent;
  470. Image img = sp.Children[0] as Image;
  471. double afterHeight = img.Height;
  472. double afterWidth = img.Width;
  473. //动画定义
  474. Storyboard myStoryboard = new Storyboard();
  475. DoubleAnimation heightAnimation = new DoubleAnimation
  476. {
  477. From = afterHeight,
  478. To = height,
  479. Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds))
  480. };
  481. DoubleAnimation widthAnimation = new DoubleAnimation
  482. {
  483. From = afterWidth,
  484. To = width,
  485. Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds))
  486. };
  487. Timeline.SetDesiredFrameRate(heightAnimation, 60);
  488. Timeline.SetDesiredFrameRate(widthAnimation, 60);
  489. Storyboard.SetTarget(widthAnimation, img);
  490. Storyboard.SetTargetProperty(widthAnimation, new PropertyPath("Width"));
  491. Storyboard.SetTarget(heightAnimation, img);
  492. Storyboard.SetTargetProperty(heightAnimation, new PropertyPath("Height"));
  493. myStoryboard.Children.Add(heightAnimation);
  494. myStoryboard.Children.Add(widthAnimation);
  495. CheckRemoveStoryboard crs = new CheckRemoveStoryboard
  496. {
  497. sb = myStoryboard,
  498. sp = sp,
  499. heightAnimation = heightAnimation,
  500. widthAnimation = widthAnimation,
  501. img = img,
  502. isMouseOver = !checkRmStoryboard
  503. };
  504. heightAnimation.Completed += (s, e) =>
  505. {
  506. if (checkRmStoryboard)
  507. {
  508. ThreadStart ts = new ThreadStart(crs.Remove);
  509. System.Threading.Thread t = new System.Threading.Thread(ts);
  510. t.IsBackground = true;
  511. t.Start();
  512. }
  513. else
  514. {
  515. img.BeginAnimation(WidthProperty, null);
  516. img.BeginAnimation(HeightProperty, null);
  517. }
  518. };
  519. img.BeginAnimation(WidthProperty, widthAnimation);
  520. img.BeginAnimation(HeightProperty, heightAnimation);
  521. //###################################################################
  522. //myStoryboard.Completed += (s, e) =>
  523. //{
  524. // if (checkRmStoryboard)
  525. // {
  526. // ThreadStart ts = new ThreadStart(crs.Remove);
  527. // System.Threading.Thread t = new System.Threading.Thread(ts);
  528. // t.Start();
  529. // }
  530. // else
  531. // {
  532. // myStoryboard.Remove();
  533. // }
  534. //};
  535. //myStoryboard.Begin();
  536. }
  537. private class CheckRemoveStoryboard
  538. {
  539. public Storyboard sb;
  540. public Panel sp;
  541. public Image img;
  542. public DoubleAnimation heightAnimation;
  543. public DoubleAnimation widthAnimation;
  544. public bool isMouseOver;
  545. public void Remove()
  546. {
  547. while (true)
  548. {
  549. if (sp.IsMouseOver == isMouseOver)
  550. {
  551. App.Current.Dispatcher.Invoke((Action)(() =>
  552. {
  553. img.BeginAnimation(WidthProperty, null);
  554. img.BeginAnimation(HeightProperty, null);
  555. //heightAnimation.FillBehavior = FillBehavior.Stop;
  556. //widthAnimation.FillBehavior = FillBehavior.Stop;
  557. }));
  558. return;
  559. }
  560. else
  561. {
  562. System.Threading.Thread.Sleep(500);
  563. }
  564. }
  565. }
  566. }
  567. public void RemoveSB(Object sb)
  568. {
  569. Storyboard sb2 = sb as Storyboard;
  570. System.Threading.Thread.Sleep(500);
  571. sb2.Remove();
  572. }
  573. /// <summary>
  574. /// 添加URL项目
  575. /// </summary>
  576. /// <param name="sender"></param>
  577. /// <param name="e"></param>
  578. private void AddUrlIcon(object sender, RoutedEventArgs e)
  579. {
  580. IconInfoUrlDialog urlDialog = new IconInfoUrlDialog();
  581. urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "IconInfoDialog");
  582. }
  583. /// <summary>
  584. /// 添加系统项目
  585. /// </summary>
  586. /// <param name="sender"></param>
  587. /// <param name="e"></param>
  588. private void AddSystemIcon(object sender, RoutedEventArgs e)
  589. {
  590. SystemItemWindow.Show();
  591. }
  592. public void VisibilitySearchCard(Visibility vb)
  593. {
  594. VerticalCard.Visibility = vb;
  595. if (vb == Visibility.Visible)
  596. {
  597. WrapCard.Visibility = Visibility.Collapsed;
  598. }
  599. else
  600. {
  601. WrapCard.Visibility = Visibility.Visible;
  602. }
  603. }
  604. /// <summary>
  605. /// 搜索Card点击事件
  606. /// </summary>
  607. /// <param name="sender"></param>
  608. /// <param name="e"></param>
  609. private void VerticalCard_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  610. {
  611. //隐藏搜索框
  612. if (RunTimeStatus.SEARCH_BOX_SHOW)
  613. {
  614. MainWindow.mainWindow.HidedSearchBox();
  615. }
  616. }
  617. /// <summary>
  618. /// 设置光标
  619. /// </summary>
  620. /// <param name="sender"></param>
  621. /// <param name="e"></param>
  622. private void CursorPanel_MouseEnter(object sender, MouseEventArgs e)
  623. {
  624. this.Cursor = Cursors.Hand;
  625. }
  626. /// <summary>
  627. /// 设置光标
  628. /// </summary>
  629. /// <param name="sender"></param>
  630. /// <param name="e"></param>
  631. private void CursorPanel_MouseLeave(object sender, MouseEventArgs e)
  632. {
  633. this.Cursor = Cursors.Arrow;
  634. }
  635. /// <summary>
  636. /// 锁定/解锁主面板
  637. /// </summary>
  638. /// <param name="sender"></param>
  639. /// <param name="e"></param>
  640. private void LockAppPanel(object sender, RoutedEventArgs e)
  641. {
  642. RunTimeStatus.LOCK_APP_PANEL = !RunTimeStatus.LOCK_APP_PANEL;
  643. }
  644. private void WrapCard_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
  645. {
  646. if (RunTimeStatus.LOCK_APP_PANEL)
  647. {
  648. CardLockCM.Header = "解锁主面板";
  649. } else
  650. {
  651. CardLockCM.Header = "锁定主面板";
  652. }
  653. }
  654. }
  655. }