1
0

RightCardControl.xaml.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. using DraggAnimatedPanelExample;
  2. using GeekDesk.Constant;
  3. using GeekDesk.Control.Other;
  4. using GeekDesk.Control.Windows;
  5. using GeekDesk.Plugins.EveryThing;
  6. using GeekDesk.Util;
  7. using GeekDesk.ViewModel;
  8. using GeekDesk.ViewModel.Temp;
  9. using HandyControl.Controls;
  10. using System;
  11. using System.Collections.ObjectModel;
  12. using System.Diagnostics;
  13. using System.IO;
  14. using System.Reflection;
  15. using System.Threading;
  16. using System.Windows;
  17. using System.Windows.Controls;
  18. using System.Windows.Input;
  19. using System.Windows.Media;
  20. using System.Windows.Media.Animation;
  21. using System.Windows.Threading;
  22. namespace GeekDesk.Control.UserControls.PannelCard
  23. {
  24. /// <summary>
  25. /// RightCardControl.xaml 的交互逻辑
  26. /// </summary>
  27. public partial class RightCardControl : UserControl
  28. {
  29. private AppData appData = MainWindow.appData;
  30. ListBoxDragDropManager<IconInfo> dragMgr;
  31. //private Thread dropCheckThread = null;
  32. public RightCardControl()
  33. {
  34. InitializeComponent();
  35. this.Loaded += RightCardControl_Loaded;
  36. }
  37. private void RightCardControl_Loaded(object sender, RoutedEventArgs e)
  38. {
  39. this.dragMgr = new ListBoxDragDropManager<IconInfo>(this.IconListBox);
  40. }
  41. //#region 图标拖动
  42. //DelegateCommand<int[]> _swap;
  43. //public DelegateCommand<int[]> SwapCommand
  44. //{
  45. // get
  46. // {
  47. // if (_swap == null)
  48. // _swap = new DelegateCommand<int[]>(
  49. // (indexes) =>
  50. // {
  51. // DROP_ICON = true;
  52. // if (appData.AppConfig.IconSortType != SortType.CUSTOM
  53. // && (dropCheckThread == null || !dropCheckThread.IsAlive))
  54. // {
  55. // dropCheckThread = new Thread(() =>
  56. // {
  57. // do
  58. // {
  59. // DROP_ICON = false;
  60. // Thread.Sleep(1000);
  61. // } while (DROP_ICON);
  62. // MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
  63. // App.Current.Dispatcher.Invoke(() =>
  64. // {
  65. // if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
  66. // || MainWindow.mainWindow.Opacity != 1)
  67. // {
  68. // Growl.WarningGlobal("已将图标排序规则重置为自定义!");
  69. // }
  70. // else
  71. // {
  72. // Growl.Warning("已将图标排序规则重置为自定义!", "MainWindowGrowl");
  73. // }
  74. // });
  75. // });
  76. // dropCheckThread.Start();
  77. // }
  78. // int fromS = indexes[0];
  79. // int to = indexes[1];
  80. // ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
  81. // var elementSource = iconList[to];
  82. // var dragged = iconList[fromS];
  83. // iconList.Remove(dragged);
  84. // iconList.Insert(to, dragged);
  85. // }
  86. // );
  87. // return _swap;
  88. // }
  89. //}
  90. //#endregion 图标拖动
  91. private void Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  92. {
  93. if (appData.AppConfig.DoubleOpen)
  94. {
  95. IconClick(sender, e);
  96. }
  97. }
  98. private void Icon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  99. {
  100. if (!appData.AppConfig.DoubleOpen)
  101. {
  102. IconClick(sender, e);
  103. }
  104. }
  105. /// <summary>
  106. /// 图标点击事件
  107. /// </summary>
  108. /// <param name="sender"></param>
  109. /// <param name="e"></param>
  110. private void IconClick(object sender, MouseButtonEventArgs e)
  111. {
  112. if (appData.AppConfig.DoubleOpen && e.ClickCount >= 2)
  113. {
  114. IconInfo icon = (IconInfo)((Panel)sender).Tag;
  115. if (icon.AdminStartUp)
  116. {
  117. ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
  118. }
  119. else
  120. {
  121. ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
  122. }
  123. }
  124. else if (!appData.AppConfig.DoubleOpen && e.ClickCount == 1)
  125. {
  126. IconInfo icon = (IconInfo)((Panel)sender).Tag;
  127. if (icon.AdminStartUp)
  128. {
  129. ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
  130. }
  131. else
  132. {
  133. ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
  134. }
  135. }
  136. }
  137. /// <summary>
  138. /// 管理员方式启动
  139. /// </summary>
  140. /// <param name="sender"></param>
  141. /// <param name="e"></param>
  142. private void IconAdminStart(object sender, RoutedEventArgs e)
  143. {
  144. IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
  145. ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
  146. }
  147. /// <summary>
  148. /// 打开文件所在位置
  149. /// </summary>
  150. /// <param name="sender"></param>
  151. /// <param name="e"></param>
  152. private void ShowInExplore(object sender, RoutedEventArgs e)
  153. {
  154. IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
  155. ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
  156. }
  157. /// <summary>
  158. /// 拖动添加项目
  159. /// </summary>
  160. /// <param name="sender"></param>
  161. /// <param name="e"></param>
  162. private void Wrap_Drop(object sender, DragEventArgs e)
  163. {
  164. Array dropObject = (System.Array)e.Data.GetData(DataFormats.FileDrop);
  165. if (dropObject == null) return;
  166. foreach (object obj in dropObject)
  167. {
  168. string path = (string)obj;
  169. IconInfo iconInfo = CommonCode.GetIconInfoByPath(path);
  170. MainWindow.appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Add(iconInfo);
  171. }
  172. CommonCode.SortIconList();
  173. CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
  174. }
  175. /// <summary>
  176. /// 从列表删除图标
  177. /// </summary>
  178. /// <param name="sender"></param>
  179. /// <param name="e"></param>
  180. private void RemoveIcon(object sender, RoutedEventArgs e)
  181. {
  182. appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Remove((IconInfo)((MenuItem)sender).Tag);
  183. }
  184. private void SystemContextMenu(object sender, RoutedEventArgs e)
  185. {
  186. IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
  187. DirectoryInfo[] folders = new DirectoryInfo[1];
  188. folders[0] = new DirectoryInfo(icon.Path);
  189. ShellContextMenu scm = new ShellContextMenu();
  190. System.Drawing.Point p = System.Windows.Forms.Cursor.Position;
  191. p.X -= 80;
  192. p.Y -= 80;
  193. scm.ShowContextMenu(folders, p);
  194. }
  195. /// <summary>
  196. /// 弹出Icon属性修改面板
  197. /// </summary>
  198. /// <param name="sender"></param>
  199. /// <param name="e"></param>
  200. private void PropertyConfig(object sender, RoutedEventArgs e)
  201. {
  202. IconInfo info = (IconInfo)((MenuItem)sender).Tag;
  203. switch (info.IconType)
  204. {
  205. case IconType.URL:
  206. IconInfoUrlDialog urlDialog = new IconInfoUrlDialog(info);
  207. urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "MainWindowDialog");
  208. break;
  209. default:
  210. IconInfoDialog dialog = new IconInfoDialog(info);
  211. dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "MainWindowDialog");
  212. break;
  213. }
  214. }
  215. private void MenuIcon_MouseEnter(object sender, MouseEventArgs e)
  216. {
  217. RunTimeStatus.MOUSE_ENTER_ICON = true;
  218. if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
  219. {
  220. ThreadPool.QueueUserWorkItem(state =>
  221. {
  222. this.Dispatcher.BeginInvoke(new Action(() =>
  223. {
  224. IconInfo info = (sender as Panel).Tag as IconInfo;
  225. MyPoptipContent.Text = info.Content;
  226. MyPoptip.VerticalOffset = 30;
  227. Thread.Sleep(50);
  228. if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
  229. {
  230. MyPoptip.IsOpen = true;
  231. }
  232. }));
  233. });
  234. }
  235. double width = appData.AppConfig.ImageWidth;
  236. double height = appData.AppConfig.ImageHeight;
  237. width += width * 0.15;
  238. height += height * 0.15;
  239. ThreadPool.QueueUserWorkItem(state =>
  240. {
  241. this.Dispatcher.BeginInvoke(new Action(() =>
  242. {
  243. ImgStoryBoard(sender, (int)width, (int)height, 1, true);
  244. }));
  245. });
  246. }
  247. private void MenuIcon_MouseLeave(object sender, MouseEventArgs e)
  248. {
  249. RunTimeStatus.MOUSE_ENTER_ICON = false;
  250. MyPoptip.IsOpen = false;
  251. ThreadPool.QueueUserWorkItem(state =>
  252. {
  253. this.Dispatcher.BeginInvoke(new Action(() =>
  254. {
  255. ImgStoryBoard(sender, appData.AppConfig.ImageWidth, appData.AppConfig.ImageHeight, 260);
  256. }));
  257. });
  258. }
  259. private void ImgStoryBoard(object sender, int height, int width, int milliseconds, bool checkRmStoryboard = false)
  260. {
  261. if (appData.AppConfig.PMModel) return;
  262. //int count = 0;
  263. //Panel sp = sender as Panel;
  264. //Image img = sp.Children[0] as Image;
  265. //int nowH = (int)img.Height;
  266. //bool isSmall = nowH > height;
  267. //if (!isSmall)
  268. //{
  269. // img.Height = height;
  270. // img.Width = width;
  271. // return;
  272. //}
  273. //double subLen = (double)Math.Abs(nowH - height) / (double)milliseconds;
  274. //new Thread(() =>
  275. //{
  276. // this.Dispatcher.Invoke(() =>
  277. // {
  278. // while (count < milliseconds)
  279. // {
  280. // if (!isSmall)
  281. // {
  282. // img.Height += subLen;
  283. // img.Width += subLen;
  284. // } else
  285. // {
  286. // //if (img.Height > 1)
  287. // //{
  288. // // img.Height -= 1;
  289. // // img.Width -= 1;
  290. // //}
  291. // Application.Current.Dispatcher.Invoke(DispatcherPriority.Background,
  292. // new Action(delegate {
  293. // img.Height -= subLen;
  294. // img.Width -= subLen;
  295. // }));
  296. // //img.Height -= subLen;
  297. // //img.Width -= subLen;
  298. // }
  299. // count++;
  300. // Thread.Sleep(1);
  301. // }
  302. // img.Height = height;
  303. // img.Width = width;
  304. // });
  305. //}).Start();
  306. Panel sp = sender as Panel;
  307. DependencyObject dos = sp.Parent;
  308. Image img = sp.Children[0] as Image;
  309. double afterHeight = img.Height;
  310. double afterWidth = img.Width;
  311. //动画定义
  312. Storyboard myStoryboard = new Storyboard();
  313. DoubleAnimation heightAnimation = new DoubleAnimation
  314. {
  315. From = afterHeight,
  316. To = height,
  317. Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds))
  318. };
  319. DoubleAnimation widthAnimation = new DoubleAnimation
  320. {
  321. From = afterWidth,
  322. To = width,
  323. Duration = new Duration(TimeSpan.FromMilliseconds(milliseconds))
  324. };
  325. Timeline.SetDesiredFrameRate(heightAnimation, 60);
  326. Timeline.SetDesiredFrameRate(widthAnimation, 60);
  327. Storyboard.SetTarget(widthAnimation, img);
  328. Storyboard.SetTargetProperty(widthAnimation, new PropertyPath("Width"));
  329. Storyboard.SetTarget(heightAnimation, img);
  330. Storyboard.SetTargetProperty(heightAnimation, new PropertyPath("Height"));
  331. myStoryboard.Children.Add(heightAnimation);
  332. myStoryboard.Children.Add(widthAnimation);
  333. CheckRemoveStoryboard crs = new CheckRemoveStoryboard
  334. {
  335. sb = myStoryboard,
  336. sp = sp,
  337. heightAnimation = heightAnimation,
  338. widthAnimation = widthAnimation,
  339. img = img,
  340. isMouseOver = !checkRmStoryboard
  341. };
  342. heightAnimation.Completed += (s, e) =>
  343. {
  344. if (checkRmStoryboard)
  345. {
  346. ThreadStart ts = new ThreadStart(crs.Remove);
  347. System.Threading.Thread t = new System.Threading.Thread(ts);
  348. t.IsBackground = true;
  349. t.Start();
  350. }
  351. else
  352. {
  353. img.BeginAnimation(WidthProperty, null);
  354. img.BeginAnimation(HeightProperty, null);
  355. }
  356. };
  357. img.BeginAnimation(WidthProperty, widthAnimation);
  358. img.BeginAnimation(HeightProperty, heightAnimation);
  359. //###################################################################
  360. //myStoryboard.Completed += (s, e) =>
  361. //{
  362. // if (checkRmStoryboard)
  363. // {
  364. // ThreadStart ts = new ThreadStart(crs.Remove);
  365. // System.Threading.Thread t = new System.Threading.Thread(ts);
  366. // t.Start();
  367. // }
  368. // else
  369. // {
  370. // myStoryboard.Remove();
  371. // }
  372. //};
  373. //myStoryboard.Begin();
  374. }
  375. private class CheckRemoveStoryboard
  376. {
  377. public Storyboard sb;
  378. public Panel sp;
  379. public Image img;
  380. public DoubleAnimation heightAnimation;
  381. public DoubleAnimation widthAnimation;
  382. public bool isMouseOver;
  383. public void Remove()
  384. {
  385. while (true)
  386. {
  387. if (sp.IsMouseOver == isMouseOver)
  388. {
  389. App.Current.Dispatcher.Invoke((Action)(() =>
  390. {
  391. img.BeginAnimation(WidthProperty, null);
  392. img.BeginAnimation(HeightProperty, null);
  393. //heightAnimation.FillBehavior = FillBehavior.Stop;
  394. //widthAnimation.FillBehavior = FillBehavior.Stop;
  395. }));
  396. return;
  397. }
  398. else
  399. {
  400. System.Threading.Thread.Sleep(500);
  401. }
  402. }
  403. }
  404. }
  405. public void RemoveSB(Object sb)
  406. {
  407. Storyboard sb2 = sb as Storyboard;
  408. System.Threading.Thread.Sleep(500);
  409. sb2.Remove();
  410. }
  411. /// <summary>
  412. /// 添加URL项目
  413. /// </summary>
  414. /// <param name="sender"></param>
  415. /// <param name="e"></param>
  416. private void AddUrlIcon(object sender, RoutedEventArgs e)
  417. {
  418. IconInfoUrlDialog urlDialog = new IconInfoUrlDialog();
  419. urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "MainWindowDialog");
  420. }
  421. /// <summary>
  422. /// 添加系统项目
  423. /// </summary>
  424. /// <param name="sender"></param>
  425. /// <param name="e"></param>
  426. private void AddSystemIcon(object sender, RoutedEventArgs e)
  427. {
  428. SystemItemWindow.Show();
  429. }
  430. public void VisibilitySearchCard(Visibility vb)
  431. {
  432. VerticalCard.Visibility = vb;
  433. if (vb == Visibility.Visible)
  434. {
  435. WrapCard.Visibility = Visibility.Collapsed;
  436. }
  437. else
  438. {
  439. WrapCard.Visibility = Visibility.Visible;
  440. }
  441. }
  442. /// <summary>
  443. /// 搜索Card点击事件
  444. /// </summary>
  445. /// <param name="sender"></param>
  446. /// <param name="e"></param>
  447. private void VerticalCard_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  448. {
  449. //隐藏搜索框
  450. if (RunTimeStatus.SEARCH_BOX_SHOW)
  451. {
  452. MainWindow.mainWindow.HidedSearchBox();
  453. }
  454. }
  455. /// <summary>
  456. /// 设置光标
  457. /// </summary>
  458. /// <param name="sender"></param>
  459. /// <param name="e"></param>
  460. private void CursorPanel_MouseEnter(object sender, MouseEventArgs e)
  461. {
  462. this.Cursor = Cursors.Hand;
  463. }
  464. /// <summary>
  465. /// 设置光标
  466. /// </summary>
  467. /// <param name="sender"></param>
  468. /// <param name="e"></param>
  469. private void CursorPanel_MouseLeave(object sender, MouseEventArgs e)
  470. {
  471. this.Cursor = Cursors.Arrow;
  472. }
  473. /// <summary>
  474. /// 锁定/解锁主面板
  475. /// </summary>
  476. /// <param name="sender"></param>
  477. /// <param name="e"></param>
  478. private void LockAppPanel(object sender, RoutedEventArgs e)
  479. {
  480. RunTimeStatus.LOCK_APP_PANEL = !RunTimeStatus.LOCK_APP_PANEL;
  481. }
  482. private void WrapCard_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
  483. {
  484. if (RunTimeStatus.LOCK_APP_PANEL)
  485. {
  486. CardLockCM.Header = "解锁主面板";
  487. }
  488. else
  489. {
  490. CardLockCM.Header = "锁定主面板";
  491. }
  492. }
  493. private void PDDialog_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  494. {
  495. if (PDDialog.Visibility == Visibility.Visible)
  496. {
  497. RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
  498. PDDialog.ClearVal();
  499. PDDialog.ErrorMsg.Visibility = Visibility.Collapsed;
  500. PDDialog.PasswordGrid.Visibility = Visibility.Visible;
  501. PDDialog.HintGrid.Visibility = Visibility.Collapsed;
  502. PDDialog.count = 0;
  503. PDDialog.SetFocus();
  504. }
  505. else
  506. {
  507. RunTimeStatus.SHOW_MENU_PASSWORDBOX = false;
  508. PDDialog.ClearVal();
  509. MainWindow.mainWindow.Focus();
  510. }
  511. }
  512. /// <summary>
  513. /// 菜单结果icon 列表鼠标滚轮预处理时间
  514. /// 主要使用自定义popup解决卡顿问题解决卡顿问题
  515. /// 以及滚动条首尾切换菜单
  516. /// </summary>
  517. /// <param name="sender"></param>
  518. /// <param name="e"></param>
  519. private void IconListBox_MouseWheel(object sender, MouseWheelEventArgs e)
  520. {
  521. //控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿
  522. MyPoptip.IsOpen = false;
  523. if (RunTimeStatus.ICONLIST_MOUSE_WHEEL)
  524. {
  525. RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500;
  526. }
  527. else
  528. {
  529. RunTimeStatus.ICONLIST_MOUSE_WHEEL = true;
  530. new Thread(() =>
  531. {
  532. while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0)
  533. {
  534. Thread.Sleep(1);
  535. RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1;
  536. }
  537. if (RunTimeStatus.MOUSE_ENTER_ICON)
  538. {
  539. this.Dispatcher.BeginInvoke(new Action(() =>
  540. {
  541. MyPoptip.IsOpen = true;
  542. }));
  543. }
  544. RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100;
  545. RunTimeStatus.ICONLIST_MOUSE_WHEEL = false;
  546. }).Start();
  547. }
  548. //修改菜单时不切换菜单
  549. if (RunTimeStatus.IS_MENU_EDIT) return;
  550. //切换菜单
  551. System.Windows.Controls.ScrollViewer scrollViewer = sender as System.Windows.Controls.ScrollViewer;
  552. if (scrollViewer == null)
  553. {
  554. //在card 上获取的事件
  555. scrollViewer = ScrollUtil.FindSimpleVisualChild<System.Windows.Controls.ScrollViewer>(IconListBox);
  556. }
  557. if (e.Delta < 0)
  558. {
  559. int index = MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex;
  560. if (ScrollUtil.IsBootomScrollView(scrollViewer))
  561. {
  562. if (index < MainWindow.mainWindow.LeftCard.MenuListBox.Items.Count - 1)
  563. {
  564. index++;
  565. }
  566. else
  567. {
  568. index = 0;
  569. }
  570. MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex = index;
  571. scrollViewer.ScrollToVerticalOffset(0);
  572. }
  573. }
  574. else if (e.Delta > 0)
  575. {
  576. if (ScrollUtil.IsTopScrollView(scrollViewer))
  577. {
  578. int index = MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex;
  579. if (index > 0)
  580. {
  581. index--;
  582. }
  583. else
  584. {
  585. index = MainWindow.mainWindow.LeftCard.MenuListBox.Items.Count - 1;
  586. }
  587. MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex = index;
  588. scrollViewer.ScrollToVerticalOffset(0);
  589. }
  590. }
  591. }
  592. /// <summary>
  593. /// menu结果ICON鼠标移动事件
  594. /// </summary>
  595. /// <param name="sender"></param>
  596. /// <param name="e"></param>
  597. private void MenuIcon_MouseMove(object sender, MouseEventArgs e)
  598. {
  599. //防止移动后不刷新popup content
  600. IconInfo info = (sender as Panel).Tag as IconInfo;
  601. MyPoptipContent.Text = info.Content;
  602. MyPoptip.VerticalOffset = 30;
  603. }
  604. }
  605. }