PDFToolsContent.xaml.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. using PDF_Office.CustomControl;
  2. using PDF_Office.Helper;
  3. using PDF_Office.ViewModels.HomePanel;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. using System.Windows.Controls;
  12. using System.Windows.Data;
  13. using System.Windows.Documents;
  14. using System.Windows.Input;
  15. using System.Windows.Media;
  16. using System.Windows.Media.Animation;
  17. using System.Windows.Media.Imaging;
  18. using System.Windows.Navigation;
  19. using System.Windows.Shapes;
  20. namespace PDF_Office.Views.HomePanel.PDFTools
  21. {
  22. /// <summary>
  23. /// ToolbarPage.xaml 的交互逻辑
  24. /// </summary>
  25. public partial class PDFToolsContent : UserControl
  26. {
  27. private ListItemQuickTool sourceListItem = null;
  28. private ListItemQuickTool targetListItem = null;
  29. private ListItemQuickTool quickSourceListItem = null;
  30. private List<QuickToolItem> quickTools = null;
  31. private List<QuickToolItem> allTools = null;
  32. private List<QuickToolItem> moreTools = null;
  33. private string fileName = string.Empty;
  34. private BitmapSource bitmapSource = null;
  35. private bool isMoreCuts = false;
  36. private bool isMove = false;
  37. private Point wrpnlPoint;
  38. private Point mousePoint;
  39. public PDFToolsContent()
  40. {
  41. InitializeComponent();
  42. quickTools = new List<QuickToolItem>();
  43. allTools = new List<QuickToolItem>();
  44. #region ListBox
  45. SetListBox();
  46. #endregion ListBox
  47. }
  48. /// <summary>
  49. /// 获取与窗口相对的鼠标位置。
  50. /// </summary>
  51. /// <param name="sender"></param>
  52. /// <param name="e"></param>
  53. private void OnRendering(object sender, EventArgs e)
  54. {
  55. mousePoint = Mouse.GetPosition(this);
  56. Console.WriteLine($"鼠标坐标:{mousePoint.X}:{mousePoint.Y}");
  57. }
  58. private void SetListBox()
  59. {
  60. string path = @"pack://application:,,,/Resources/PromotionIcon/Windows.png";
  61. List<string> all = new List<string>() { "PDF转Word", "PDF转Excel", "PDF转PPT", "转档PDF", "OCR", "拆分",
  62. "提取","合并","压缩","图片转PDF","安全", "水印", "页眉页脚","贝茨Bates码","批量处理","打印", "背景","插入","文件对比"};
  63. for (int i = 0; i < all.Count; i++)
  64. {
  65. QuickToolItem aToolModule = new QuickToolItem();
  66. aToolModule.Id = i + 1;
  67. aToolModule.Name = all[i];
  68. aToolModule.Image = path;
  69. allTools.Add(aToolModule);
  70. }
  71. //取前10个,如果List里面数据少于5个,则返回所有的
  72. quickTools = allTools.Take(8).ToList<QuickToolItem>();
  73. ListShortCuts.ItemsSource = quickTools;
  74. //对比两个集合,取差值
  75. moreTools = allTools.Except(quickTools).ToList();
  76. ListMoreCuts.ItemsSource = moreTools;
  77. }
  78. private void Page_Loaded(object sender, RoutedEventArgs e)
  79. {
  80. }
  81. private void ListBoxMoreCuts_PreviewMouseMove(object sender, MouseEventArgs e)
  82. {
  83. var pos = e.GetPosition(ListMoreCuts);
  84. if (e.LeftButton == MouseButtonState.Pressed)
  85. {
  86. ListMoreCuts.AllowDrop = true;
  87. HitTestResult result = VisualTreeHelper.HitTest(ListMoreCuts, pos);
  88. if (result == null)
  89. {
  90. sourceImage.Visibility = Visibility.Hidden;
  91. return;
  92. }
  93. sourceListItem = (ListItemQuickTool)CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
  94. if (sourceListItem == null || sourceListItem.Content != ListMoreCuts.SelectedItem)
  95. {
  96. return;
  97. }
  98. //获取控件相对于另一控件的坐标
  99. wrpnlPoint = sourceListItem.TranslatePoint(new Point(), this);
  100. System.Windows.DataObject dataObj = new System.Windows.DataObject(sourceListItem.Content as QuickToolItem);
  101. if (dataObj != null)
  102. {
  103. //控件截图
  104. IsMoreToolbars();
  105. if (string.IsNullOrEmpty(fileName))
  106. {
  107. sourceImage.Visibility = Visibility.Hidden;
  108. return;
  109. }
  110. //图片解码
  111. ImageDecoding();
  112. isMoreCuts = true;
  113. DragDrop.DoDragDrop(ListMoreCuts, dataObj, System.Windows.DragDropEffects.Move);
  114. }
  115. }
  116. else
  117. {
  118. moveImage.Visibility = Visibility.Hidden;
  119. sourceImage.Visibility = Visibility.Hidden;
  120. }
  121. }
  122. private void ImageDecoding()
  123. {
  124. Stream imageStreamSource = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
  125. PngBitmapDecoder decoder = new PngBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
  126. bitmapSource = decoder.Frames[0];
  127. }
  128. private void IsMoreToolbars()
  129. {
  130. var source = sourceListItem.Content as QuickToolItem;
  131. if (moreTools == null && moreTools.Count != 0) return;
  132. List<QuickToolItem> toolModule = moreTools.FindAll(item => item.Name == source.Name);
  133. if (toolModule.Count > 0)
  134. {
  135. // 判断文件夹是否存在,不存在则创建
  136. DirectoryInfo folder = new DirectoryInfo(System.IO.Path.Combine(System.IO.Path.GetTempPath(), "Asource"));
  137. if (!folder.Exists)
  138. {
  139. folder.Create();
  140. }
  141. fileName = System.IO.Path.Combine(folder.FullName, $"{source.Name}.png");
  142. SaveToPng(sourceListItem, fileName);
  143. }
  144. }
  145. private void ListBoxShortCuts_Drop(object sender, DragEventArgs e)
  146. {
  147. var pos = e.GetPosition(ListShortCuts);
  148. var result = VisualTreeHelper.HitTest(ListShortCuts, pos);
  149. if (result == null)
  150. {
  151. WorkingWithAnimation(pos);
  152. return;
  153. }
  154. //查找目标数据
  155. targetListItem = (ListItemQuickTool)CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
  156. if (targetListItem == null)
  157. {
  158. WorkingWithAnimation(pos);
  159. return;
  160. }
  161. var targetAToolModule = targetListItem.Content as QuickToolItem;
  162. QuickToolItem target = quickTools.Find(c => c.Name == targetAToolModule.Name);
  163. //查找元数据
  164. var sourceAToolModule = e.Data.GetData(typeof(QuickToolItem)) as QuickToolItem;
  165. if (sourceAToolModule == null)
  166. {
  167. sourceImage.Visibility = Visibility.Hidden;
  168. // target.SetValue(AToolModule.IsFilePickedProperty, false);
  169. return;
  170. }
  171. if (ReferenceEquals(targetAToolModule, sourceAToolModule))
  172. {
  173. sourceImage.Visibility = Visibility.Hidden;
  174. // target.SetValue(AToolModule.IsFilePickedProperty, false);
  175. return;
  176. }
  177. if (targetAToolModule == null && sourceAToolModule == null)
  178. {
  179. sourceImage.Visibility = Visibility.Hidden;
  180. // target.SetValue(AToolModule.IsFilePickedProperty, false);
  181. return;
  182. }
  183. ModuleExchange(sourceAToolModule, targetAToolModule);
  184. }
  185. private void ModuleExchange(QuickToolItem sourceAToolModule, QuickToolItem targetAToolModule)
  186. {
  187. if (moreTools == null) return;
  188. QuickToolItem source = moreTools.Find(c => c.Name == sourceAToolModule.Name);
  189. int targetIndex = quickTools.FindIndex(item => item.Name == targetAToolModule.Name);
  190. if (targetIndex < 0) return;
  191. if (!isMoreCuts)
  192. {
  193. ListMoreCuts.AllowDrop = false;
  194. sourceImage.Visibility = Visibility.Hidden;
  195. source = quickTools.Find(c => c.Name == sourceAToolModule.Name);
  196. if (source == null) return;
  197. int sourceIndex = quickTools.FindIndex(item => item.Name == sourceAToolModule.Name);
  198. if (sourceIndex < 0) return;
  199. var temp = quickTools[sourceIndex];
  200. quickTools[sourceIndex] = quickTools[targetIndex];
  201. quickTools[targetIndex] = temp;
  202. ListShortCuts.Items.Refresh();
  203. ListBoxCutsWidthChanged(ListShortCuts);
  204. }
  205. else
  206. {
  207. if (target == null) return;
  208. if (source == null) return;
  209. moreTools.Remove(source);
  210. moreTools.Insert(0, target);
  211. quickTools.Remove(target);
  212. quickTools.Insert(targetIndex, source);
  213. ListMoreCuts.Items.Refresh();
  214. ListShortCuts.Items.Refresh();
  215. sourceImage.Visibility = Visibility.Hidden;
  216. targetListItem.IsOverModular = false;
  217. ListBoxCutsWidthChanged(ListShortCuts);
  218. ListBoxCutsWidthChanged(ListMoreCuts);
  219. }
  220. }
  221. private void WorkingWithAnimation(Point pos)
  222. {
  223. sourceImage.Visibility = Visibility.Hidden;
  224. if (!isMoreCuts || !isMove)
  225. {
  226. moveImage.Visibility = Visibility.Hidden;
  227. }
  228. else
  229. {
  230. if (sourceListItem == null) return;
  231. moveImage.Visibility = Visibility.Visible;
  232. Point point = sourceListItem.TransformToAncestor(this).Transform(new Point(0, 0));
  233. ImageMoveTo(new Point(pos.X - 80, pos.Y), new Point(wrpnlPoint.X + 40, wrpnlPoint.Y), moveImage, 200);
  234. }
  235. }
  236. /// <summary>
  237. /// 图片移动动画
  238. /// </summary>
  239. /// <param name="curPoint">初始位置</param>
  240. /// <param name="deskPoint">控件要移动到的位置</param>
  241. /// <param name="ell">你要移动的空间</param>
  242. /// <param name="space">设置移动的时间片(关系到控件移动的速度)</param>
  243. private void ImageMoveTo(Point curPoint, Point deskPoint, Image ell, double space)
  244. {
  245. Storyboard storyboard = new Storyboard(); //创建Storyboard对象
  246. double lxspeed = space, lyspeed = space; //设置X方向 / Y方向 移动时间片
  247. //创建X轴方向动画
  248. DoubleAnimation dox = new DoubleAnimation(
  249. curPoint.X,
  250. deskPoint.X,
  251. new Duration(TimeSpan.FromMilliseconds(lxspeed))
  252. );
  253. //创建Y轴方向动画
  254. DoubleAnimation doy = new DoubleAnimation(
  255. curPoint.Y,
  256. deskPoint.Y,
  257. new Duration(TimeSpan.FromMilliseconds(lyspeed))
  258. );
  259. Storyboard.SetTarget(dox, ell);
  260. Storyboard.SetTarget(doy, ell);
  261. Storyboard.SetTargetProperty(dox, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)"));
  262. Storyboard.SetTargetProperty(doy, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.Y)"));
  263. storyboard.Children.Add(dox);
  264. storyboard.Children.Add(doy);
  265. storyboard.Completed += Storyboard_Completed;
  266. //动画播放
  267. storyboard.Begin();
  268. }
  269. private void Storyboard_Completed(object sender, EventArgs e)
  270. {
  271. moveImage.Visibility = Visibility.Hidden;
  272. }
  273. /// <summary>
  274. /// 控件截图
  275. /// </summary>
  276. /// <param name="visual">控件</param>
  277. /// <param name="fileName">文件路径 C:\Users\oyxh\AppData\Local\Temp\</param>
  278. private void SaveToPng(FrameworkElement visual, string fileName)
  279. {
  280. DrawingVisual drawingVisual = new DrawingVisual();
  281. using (DrawingContext context = drawingVisual.RenderOpen())
  282. {
  283. VisualBrush brush = new VisualBrush(sourceListItem) { Stretch = Stretch.None };
  284. context.DrawRectangle(brush, null, new Rect(0, 0, sourceListItem.ActualWidth, sourceListItem.ActualHeight));
  285. context.Close();
  286. }
  287. RenderTargetBitmap targetBitmap = new RenderTargetBitmap((int)sourceListItem.ActualWidth, (int)sourceListItem.ActualHeight, 96d, 96d, PixelFormats.Default);
  288. targetBitmap.Render(drawingVisual);
  289. FileStream stream = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
  290. PngBitmapEncoder encoder = new PngBitmapEncoder();
  291. encoder.Interlace = PngInterlaceOption.On;
  292. encoder.Frames.Add(BitmapFrame.Create(targetBitmap));
  293. encoder.Save(stream);
  294. stream.Close();
  295. }
  296. private QuickToolItem target;
  297. private void ListBoxShortCuts_DragOver(object sender, DragEventArgs e)
  298. {
  299. var pos = e.GetPosition(ListShortCuts);
  300. Console.WriteLine($"pos:{pos.X} {pos.Y} this.Grid.ActualHeight1 {this.Grid.ActualHeight}");
  301. if (pos.Y < 0)
  302. {
  303. isMove = false;
  304. sourceImage.Visibility = Visibility.Hidden;
  305. sourceListItem = null;
  306. return;
  307. }
  308. if (pos.Y >= this.Grid.ActualHeight - 50)
  309. {
  310. isMove = false;
  311. sourceImage.Visibility = Visibility.Hidden;
  312. sourceListItem = null;
  313. return;
  314. }
  315. if (pos.X < 10)
  316. {
  317. isMove = false;
  318. sourceListItem = null;
  319. sourceImage.Visibility = Visibility.Hidden;
  320. return;
  321. }
  322. if (pos.X >= this.Grid.ActualWidth - 10)
  323. {
  324. isMove = false;
  325. sourceListItem = null;
  326. sourceImage.Visibility = Visibility.Hidden;
  327. return;
  328. }
  329. if (!isMoreCuts)
  330. {
  331. var sourceAToolModule = e.Data.GetData(typeof(QuickToolItem)) as QuickToolItem;
  332. if (sourceAToolModule == null) return;
  333. int sourceIndex = quickTools.FindIndex(item => item.Name == sourceAToolModule.Name);
  334. //根据index找listbox对应的item
  335. sourceListItem = (ListItemQuickTool)(ListShortCuts.ItemContainerGenerator.ContainerFromIndex(sourceIndex) as FrameworkElement);
  336. if (sourceListItem == null)
  337. {
  338. return;
  339. }
  340. ListMoreCuts.AllowDrop = false;
  341. sourceImage.Visibility = Visibility.Hidden;
  342. }
  343. else
  344. {
  345. var sourceAToolModule = e.Data.GetData(typeof(QuickToolItem)) as QuickToolItem;
  346. if (sourceAToolModule == null) return;
  347. int sourceIndex = moreTools.FindIndex(item => item.Name == sourceAToolModule.Name);
  348. //根据index找listbox对应的item
  349. sourceListItem = (ListItemQuickTool)(ListMoreCuts.ItemContainerGenerator.ContainerFromIndex(sourceIndex) as FrameworkElement);
  350. if (sourceListItem == null)
  351. {
  352. return;
  353. }
  354. isMove = true;
  355. //图片绑定
  356. ImageBinding(pos);
  357. }
  358. var result = VisualTreeHelper.HitTest(ListShortCuts, pos);
  359. if (result == null)
  360. {
  361. return;
  362. }
  363. //查找目标数据
  364. targetListItem = (ListItemQuickTool)CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
  365. if (targetListItem == null)
  366. {
  367. //sourceImage.Visibility = Visibility.Hidden;
  368. return;
  369. }
  370. var targetAToolModule = targetListItem.Content as QuickToolItem;
  371. if (targetAToolModule == null) return;
  372. target = quickTools.Find(c => c.Name == targetAToolModule.Name);
  373. }
  374. /// <summary>
  375. ///图片绑定
  376. /// </summary>
  377. private void ImageBinding(System.Windows.Point pos)
  378. {
  379. sourceImage.Visibility = Visibility.Visible;
  380. sourceImage.Source = bitmapSource;
  381. sourceImage.Margin = new Thickness(pos.X - 80, pos.Y, 0, 0);
  382. moveImage.Source = sourceImage.Source;
  383. }
  384. private void ListBoxShortCuts_PreviewMouseMove(object sender, MouseEventArgs e)
  385. {
  386. if (e.LeftButton == MouseButtonState.Pressed)
  387. {
  388. ListMoreCuts.AllowDrop = false;
  389. var pos = e.GetPosition(ListShortCuts);
  390. HitTestResult result = VisualTreeHelper.HitTest(ListShortCuts, pos);
  391. if (result == null)
  392. {
  393. return;
  394. }
  395. quickSourceListItem = (ListItemQuickTool)CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
  396. if (quickSourceListItem == null || quickSourceListItem.Content != ListShortCuts.SelectedItem)
  397. {
  398. return;
  399. }
  400. System.Windows.DataObject dataObj = new System.Windows.DataObject(quickSourceListItem.Content as QuickToolItem);
  401. if (dataObj != null)
  402. {
  403. isMoreCuts = false;
  404. DragDrop.DoDragDrop(ListShortCuts, dataObj, System.Windows.DragDropEffects.Move);
  405. }
  406. }
  407. else
  408. {
  409. sourceImage.Visibility = Visibility.Hidden;
  410. //moveImage.Visibility = Visibility.Hidden;
  411. }
  412. }
  413. private void sourceImage_Drop(object sender, DragEventArgs e)
  414. {
  415. ListBoxShortCuts_Drop(sender, e);
  416. }
  417. private void sourceImage_PreviewMouseMove(object sender, MouseEventArgs e)
  418. {
  419. ListBoxMoreCuts_PreviewMouseMove(sender, e);
  420. }
  421. private void sourceImage_DragOver(object sender, DragEventArgs e)
  422. {
  423. ListBoxShortCuts_DragOver(sender, e);
  424. }
  425. private void Label_PreviewMouseMove(object sender, MouseEventArgs e)
  426. {
  427. ListBoxMoreCuts_PreviewMouseMove(sender, e);
  428. }
  429. private void ListBoxMoreCuts_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  430. {
  431. //获取当前控件元素相对鼠标点击的位置(只有点击在当前A控件,会触发事件并返回相对A控件的鼠标位置)。
  432. Point pp = Mouse.GetPosition(e.Source as FrameworkElement);//WPF方法
  433. sourceImage.Visibility = Visibility.Hidden;
  434. if (pp.X < 0 || pp.Y < 0)
  435. {
  436. moveImage.Visibility = Visibility.Hidden;
  437. }
  438. }
  439. /// <summary>
  440. /// 扩展收缩UI
  441. /// </summary>
  442. /// <param name="IsShowConciseContent">是否收缩</param>
  443. private void ShowToolsUI(ListBoxEx list,bool IsShowConciseContent)
  444. {
  445. foreach (var item in list.Items)
  446. {
  447. var listBoxItem = list.ItemContainerGenerator.ContainerFromItem(item) as ListBoxItem;
  448. if (listBoxItem != null)
  449. {
  450. var viewItem = listBoxItem.ContentTemplate;
  451. var myContentPresenter = CommonHelper.FindVisualChild<ContentPresenter>(listBoxItem);
  452. var obj = viewItem.FindName("data", myContentPresenter);
  453. var checkNum = obj as PDFToolItem;
  454. if (checkNum != null)
  455. {
  456. checkNum.IsShowConciseContent = IsShowConciseContent;
  457. }
  458. }
  459. }
  460. }
  461. private void ListBoxShortCuts_SizeChanged(object sender, SizeChangedEventArgs e)
  462. {
  463. ListBoxCutsWidthChanged(ListShortCuts);
  464. }
  465. private void ListBoxMoreCuts_SizeChanged(object sender, SizeChangedEventArgs e)
  466. {
  467. ListBoxCutsWidthChanged(ListMoreCuts);
  468. }
  469. private void ListBoxCutsWidthChanged(ListBoxEx list)
  470. {
  471. //3x + 4y = containerWidth;
  472. //3x = y;
  473. //x为间距,y为item;
  474. double containerWidth = list.ActualWidth - 20;
  475. int widthItem = (int)containerWidth / 5;
  476. double margin = widthItem / 3;
  477. int i = 0;
  478. foreach (var item in list.Items)
  479. {
  480. i++;
  481. var listBoxItem = list.ItemContainerGenerator.ContainerFromItem(item) as ListBoxItem;
  482. if (listBoxItem != null)
  483. {
  484. if (i % 4 != 0)
  485. {
  486. listBoxItem.Margin = new Thickness(0, 0, margin, 0);
  487. }
  488. else
  489. {
  490. listBoxItem.Margin = new Thickness(0, 0, 0, 0);
  491. }
  492. listBoxItem.Width = widthItem;
  493. }
  494. }
  495. }
  496. private void BtnTools_Click(object sender, RoutedEventArgs e)
  497. {
  498. }
  499. bool isExtend = false;
  500. private void BtnMore_Click(object sender, RoutedEventArgs e)
  501. {
  502. if(isExtend)
  503. {
  504. isExtend = false;
  505. ShowToolsUI(ListShortCuts, false);
  506. ShowToolsUI(ListMoreCuts, false);
  507. }
  508. else
  509. {
  510. isExtend = true;
  511. ShowToolsUI(ListShortCuts, true);
  512. ShowToolsUI(ListMoreCuts, true);
  513. }
  514. }
  515. //自适应流式布局,以防改需求备用
  516. //private void ListBoxMoreCutsWidthChanged()
  517. //{
  518. // double containerWidth = ListBoxShortCuts.ActualWidth;
  519. // int Rowcount = (int)containerWidth / 240;
  520. // double EndRow = containerWidth % 240.0;
  521. // Rowcount = EndRow >= 140 ? ++Rowcount : Rowcount;
  522. // int i = 0;
  523. // foreach (var item in ListBoxMoreCuts.Items)
  524. // {
  525. // i++;
  526. // var listBoxItem = ListBoxMoreCuts.ItemContainerGenerator.ContainerFromItem(item) as ListBoxItem;
  527. // if (listBoxItem != null)
  528. // {
  529. // if (i % Rowcount != 0)
  530. // {
  531. // listBoxItem.Margin = new Thickness(0, 0, 100, 0);
  532. // }
  533. // else
  534. // {
  535. // listBoxItem.Margin = new Thickness(0, 0, 0, 0);
  536. // }
  537. // }
  538. // }
  539. //}
  540. }
  541. }