MainWindow.xaml.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. using ComPDFKit.PDFDocument;
  2. using compdfkit_tools.Data;
  3. using compdfkit_tools.Helper;
  4. using compdfkit_tools.PDFControl;
  5. using compdfkit_tools.PDFControlUI;
  6. using ComPDFKitViewer;
  7. using ComPDFKitViewer.PdfViewer;
  8. using Microsoft.Win32;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Runtime.CompilerServices;
  13. using System.Windows;
  14. using System.Windows.Annotations;
  15. using System.Windows.Controls;
  16. using System.Windows.Controls.Primitives;
  17. using System.Windows.Input;
  18. namespace viewer_ctrl_demo
  19. {
  20. /// <summary>
  21. /// Interaction logic for MainWindow.xaml
  22. /// </summary>
  23. public partial class MainWindow : Window
  24. {
  25. private PDFViewControl passwordViewer;
  26. private PDFViewControl pdfViewControl;
  27. private CPDFAnnotationControl pdfAnnotationControl = null;
  28. private double[] zoomLevelList = { 1f, 8f, 12f, 25, 33f, 50, 66f, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
  29. public MainWindow()
  30. {
  31. InitializeComponent();
  32. DataContext = this;
  33. }
  34. private void MainWindow_Loaded(object sender, RoutedEventArgs e)
  35. {
  36. pdfAnnotationControl = new CPDFAnnotationControl();
  37. LoadDefaultDocument();
  38. BindZoomLevel();
  39. }
  40. private void BindZoomLevel()
  41. {
  42. foreach (double zoomLevel in zoomLevelList)
  43. {
  44. ComboBoxItem zoomItem = new ComboBoxItem();
  45. zoomItem.Content = zoomLevel + "%";
  46. ZoomComboBox.Items.Add(zoomItem);
  47. }
  48. }
  49. private void LoadDocument()
  50. {
  51. pdfViewControl.PDFView?.Load();
  52. PDFGrid.Child = pdfViewControl;
  53. pdfViewControl.PDFView.InfoChanged -= PdfViewer_InfoChanged;
  54. pdfViewControl.PDFView.InfoChanged += PdfViewer_InfoChanged;
  55. pdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
  56. PasswordUI.Closed += PasswordUI_Closed;
  57. PasswordUI.Canceled += PasswordUI_Canceled;
  58. PasswordUI.Confirmed += PasswordUI_Confirmed;
  59. UIElement currentBotaTool = GetBotaTool();
  60. if (currentBotaTool is CPDFSearchControl)
  61. {
  62. ((CPDFSearchControl)currentBotaTool).InitWithPDFViewer(pdfViewControl.PDFView);
  63. }
  64. if (currentBotaTool is CPDFThumbnailControl)
  65. {
  66. ((CPDFThumbnailControl)currentBotaTool).InitWithPDFViewer(pdfViewControl.PDFView);
  67. ((CPDFThumbnailControl)currentBotaTool).ThumbLoaded = false;
  68. ((CPDFThumbnailControl)currentBotaTool).LoadThumb();
  69. }
  70. if (currentBotaTool is CPDFBookmarkControl)
  71. {
  72. ((CPDFBookmarkControl)currentBotaTool).InitWithPDFViewer(pdfViewControl.PDFView);
  73. ((CPDFBookmarkControl)currentBotaTool).LoadBookmark();
  74. }
  75. ZoomTextBox.Text = string.Format("{0}", (int)(pdfViewControl.PDFView.ZoomFactor * 100)) + "%";
  76. InitialPDFViewControl(pdfViewControl);
  77. }
  78. private void PDFView_AnnotCommandHandler(object sender, ComPDFKitViewer.AnnotEvent.AnnotCommandArgs e)
  79. {
  80. switch (e.CommandType)
  81. {
  82. case CommandType.Context:
  83. e.Handle = true;
  84. if (e.CommandTarget == TargetType.Annot)
  85. {
  86. e.Handle = true;
  87. e.PopupMenu = new ContextMenu();
  88. if (e.PressOnLink)
  89. {
  90. e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  91. }
  92. else if (e.PressOnAnnot)
  93. {
  94. e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  95. e.PopupMenu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
  96. e.PopupMenu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
  97. }
  98. else if (e.PressOnMedia || e.PressOnSound)
  99. {
  100. e.Handle = true;
  101. e.PopupMenu.Items.Add(new MenuItem() { Header = "Play", Command = MediaCommands.Play, CommandTarget = (UIElement)sender, CommandParameter = e });
  102. e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  103. }
  104. else
  105. {
  106. e.Handle = true;
  107. e.PopupMenu = new ContextMenu();
  108. e.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  109. }
  110. }
  111. break;
  112. default:
  113. break;
  114. }
  115. }
  116. private void PasswordUI_Confirmed(object sender, string e)
  117. {
  118. if (passwordViewer != null && passwordViewer.PDFView != null && passwordViewer.PDFView.Document != null)
  119. {
  120. passwordViewer.PDFView.Document.UnlockWithPassword(e);
  121. if (passwordViewer.PDFView.Document.IsLocked == false)
  122. {
  123. PasswordUI.SetShowError("", Visibility.Collapsed);
  124. PasswordUI.ClearPassword();
  125. PasswordUI.Visibility = Visibility.Collapsed;
  126. PopupBorder.Visibility = Visibility.Collapsed;
  127. pdfViewControl = passwordViewer;
  128. LoadDocument();
  129. }
  130. else
  131. {
  132. PasswordUI.SetShowError("error", Visibility.Visible);
  133. }
  134. }
  135. }
  136. private void PasswordUI_Canceled(object sender, EventArgs e)
  137. {
  138. PopupBorder.Visibility = Visibility.Collapsed;
  139. PasswordUI.Visibility = Visibility.Collapsed;
  140. }
  141. private void PasswordUI_Closed(object sender, EventArgs e)
  142. {
  143. PopupBorder.Visibility = Visibility.Collapsed;
  144. PasswordUI.Visibility = Visibility.Collapsed;
  145. }
  146. private void PdfViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
  147. {
  148. if (e.Key == "PageNum")
  149. {
  150. PageRangeText.Text = string.Format("{0}/{1}", e.Value, pdfViewControl.PDFView.Document.PageCount);
  151. }
  152. if (e.Key == "Zoom")
  153. {
  154. ZoomTextBox.Text = string.Format("{0}", (int)((double)e.Value * 100)) + "%";
  155. }
  156. }
  157. private double CheckZoomLevel(double zoom, bool IsGrowth)
  158. {
  159. double standardZoom = 100;
  160. if (zoom <= 0.01)
  161. {
  162. return 0.01;
  163. }
  164. if (zoom >= 10)
  165. {
  166. return 10;
  167. }
  168. zoom *= 100;
  169. for (int i = 0; i < zoomLevelList.Length - 1; i++)
  170. {
  171. if (zoom > zoomLevelList[i] && zoom <= zoomLevelList[i + 1] && IsGrowth)
  172. {
  173. standardZoom = zoomLevelList[i + 1];
  174. break;
  175. }
  176. if (zoom >= zoomLevelList[i] && zoom < zoomLevelList[i + 1] && !IsGrowth)
  177. {
  178. standardZoom = zoomLevelList[i];
  179. break;
  180. }
  181. }
  182. return standardZoom / 100;
  183. }
  184. private void LoadDefaultDocument()
  185. {
  186. string defaultFilePath = "developer_guide_windows.pdf";
  187. pdfViewControl = new PDFViewControl();
  188. pdfViewControl.PDFView.InitDocument(defaultFilePath);
  189. LoadDocument();
  190. }
  191. /// <summary>
  192. /// 搜索工具点击处理
  193. /// </summary>
  194. private void SearchToolButton_Click(object sender, RoutedEventArgs e)
  195. {
  196. UIElement botaTool = GetBotaTool();
  197. if (botaTool == null || !(botaTool is CPDFSearchControl))
  198. {
  199. CPDFSearchControl searchControl = new CPDFSearchControl();
  200. if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
  201. {
  202. searchControl.InitWithPDFViewer(pdfViewControl.PDFView);
  203. }
  204. SetBotaTool(searchControl);
  205. }
  206. ExpandBotaTool(SearchToolButton.IsChecked == true);
  207. ClearToolState(SearchToolButton);
  208. }
  209. /// <summary>
  210. /// 缩略图列表点击处理
  211. /// </summary>
  212. private void ThumbToolButton_Click(object sender, RoutedEventArgs e)
  213. {
  214. UIElement botaTool = GetBotaTool();
  215. if (botaTool == null || !(botaTool is CPDFThumbnailControl))
  216. {
  217. CPDFThumbnailControl thumbControl = new CPDFThumbnailControl();
  218. if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
  219. {
  220. thumbControl.InitWithPDFViewer(pdfViewControl.PDFView);
  221. thumbControl.LoadThumb();
  222. }
  223. SetBotaTool(thumbControl);
  224. }
  225. ExpandBotaTool(ThumbToolButton.IsChecked == true);
  226. ClearToolState(ThumbToolButton);
  227. }
  228. /// <summary>
  229. /// 书签列表点击处理
  230. /// </summary>
  231. private void BookmarkToolButtonn_Click(object sender, RoutedEventArgs e)
  232. {
  233. UIElement botaTool = GetBotaTool();
  234. if (botaTool == null || !(botaTool is CPDFBookmarkControl))
  235. {
  236. CPDFBookmarkControl bookmarkControl = new CPDFBookmarkControl();
  237. if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
  238. {
  239. bookmarkControl.InitWithPDFViewer(pdfViewControl.PDFView);
  240. bookmarkControl.LoadBookmark();
  241. }
  242. SetBotaTool(bookmarkControl);
  243. }
  244. ExpandBotaTool(BookmarkToolButton.IsChecked == true);
  245. ClearToolState(BookmarkToolButton);
  246. }
  247. /// <summary>
  248. /// 大纲列表处理
  249. /// </summary>
  250. private void OutlineToolButton_Click(object sender, RoutedEventArgs e)
  251. {
  252. UIElement botaTool = GetBotaTool();
  253. if (botaTool == null || !(botaTool is CPDFOutlineControl))
  254. {
  255. CPDFOutlineControl outlineControl = new CPDFOutlineControl();
  256. if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
  257. {
  258. outlineControl.InitWithPDFViewer(pdfViewControl.PDFView);
  259. }
  260. SetBotaTool(outlineControl);
  261. }
  262. ExpandBotaTool(OutlineToolButton.IsChecked == true);
  263. ClearToolState(OutlineToolButton);
  264. }
  265. /// <summary>
  266. /// 设置Bota工具内容
  267. /// </summary>
  268. /// <param name="newChild"></param>
  269. private void SetBotaTool(UIElement newChild)
  270. {
  271. BotaToolContainer.Child = newChild;
  272. }
  273. /// <summary>
  274. /// 获取Bota工具
  275. /// </summary>
  276. /// <returns></returns>
  277. private UIElement GetBotaTool()
  278. {
  279. return BotaToolContainer.Child;
  280. }
  281. /// <summary>
  282. /// 展开Bota工具
  283. /// </summary>
  284. /// <param name="isExpand"></param>
  285. private void ExpandBotaTool(bool isExpand)
  286. {
  287. BotaToolContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  288. Splitter.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  289. }
  290. /// <summary>
  291. /// 清除左边工具栏状态
  292. /// </summary>
  293. private void ClearToolState(UIElement ignoreTool)
  294. {
  295. foreach (UIElement child in BotaSideTool.Children)
  296. {
  297. if (child != ignoreTool && child is ToggleButton buttonTool)
  298. {
  299. buttonTool.IsChecked = false;
  300. }
  301. }
  302. }
  303. private void ToolExpand_Click(object sender, RoutedEventArgs e)
  304. {
  305. ToggleButton expandBtn = sender as ToggleButton;
  306. if (expandBtn != null)
  307. {
  308. bool isExpand = expandBtn.IsChecked == true;
  309. ExpandLeftPanel(isExpand);
  310. if (isExpand)
  311. {
  312. ThumbToolButton.IsChecked = isExpand;
  313. ThumbToolButton_Click(ThumbToolButton, new RoutedEventArgs());
  314. }
  315. }
  316. }
  317. private void ExpandSearchBtn_Click(object sender, RoutedEventArgs e)
  318. {
  319. ExpandLeftPanel(true);
  320. SearchToolButton.IsChecked = true;
  321. SearchToolButton_Click(SearchToolButton, new RoutedEventArgs());
  322. }
  323. private void ExpandLeftPanel(bool isExpand)
  324. {
  325. ExpandToolContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  326. Splitter.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  327. if (isExpand)
  328. {
  329. BodyGrid.ColumnDefinitions[0].Width = new GridLength(260);
  330. BodyGrid.ColumnDefinitions[1].Width = new GridLength(15);
  331. }
  332. else
  333. {
  334. BodyGrid.ColumnDefinitions[0].Width = new GridLength(0);
  335. BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
  336. }
  337. }
  338. private void Border_MouseEnter(object sender, MouseEventArgs e)
  339. {
  340. FloatPageTool.Visibility = Visibility.Visible;
  341. }
  342. private void PDFGrid_MouseMove(object sender, MouseEventArgs e)
  343. {
  344. FloatPageTool.Visibility = Visibility.Collapsed;
  345. }
  346. private void ViewSettingBtn_Click(object sender, RoutedEventArgs e)
  347. {
  348. ToggleButton toggleButton = sender as ToggleButton;
  349. if (toggleButton != null)
  350. {
  351. if (toggleButton.IsChecked == true)
  352. {
  353. CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
  354. displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
  355. PropertyContainer.Child = displayPanel;
  356. PropertyContainer.Visibility = Visibility.Visible;
  357. }
  358. else
  359. {
  360. PropertyContainer.Child = null;
  361. PropertyContainer.Visibility = Visibility.Collapsed;
  362. }
  363. }
  364. }
  365. private void ZoomComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  366. {
  367. ComboBoxItem selectItem = ZoomComboBox.SelectedItem as ComboBoxItem;
  368. if (selectItem != null && selectItem.Content != null && pdfViewControl != null)
  369. {
  370. if (double.TryParse(selectItem.Content.ToString().TrimEnd('%'), out double zoomLevel))
  371. {
  372. pdfViewControl.PDFView.Zoom(zoomLevel / 100D);
  373. ZoomTextBox.Text = string.Format("{0}", (int)(pdfViewControl.PDFView.ZoomFactor * 100)) + "%";
  374. }
  375. }
  376. }
  377. private void ZoomInBtn_Click(object sender, RoutedEventArgs e)
  378. {
  379. if (pdfViewControl != null)
  380. {
  381. double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor + 0.01, true);
  382. pdfViewControl.PDFView.Zoom(newZoom);
  383. ZoomTextBox.Text = string.Format("{0}", (int)(newZoom * 100)) + "%";
  384. }
  385. }
  386. private void ZoomOutBtn_Click(object sender, RoutedEventArgs e)
  387. {
  388. if (pdfViewControl != null)
  389. {
  390. double newZoom = CheckZoomLevel(pdfViewControl.PDFView.ZoomFactor - 0.01, false);
  391. pdfViewControl.PDFView.Zoom(newZoom);
  392. ZoomTextBox.Text = string.Format("{0}", (int)(newZoom * 100)) + "%";
  393. }
  394. }
  395. private void NextPageBorder_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  396. {
  397. pdfViewControl.PDFView?.GoToPage(pdfViewControl.PDFView.CurrentIndex + 1);
  398. }
  399. private void PrevPageBorder_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  400. {
  401. pdfViewControl.PDFView?.GoToPage(pdfViewControl.PDFView.CurrentIndex - 1);
  402. }
  403. private void PageInfoBtn_Click(object sender, RoutedEventArgs e)
  404. {
  405. PasswordUI.Visibility = Visibility.Collapsed;
  406. FileInfoUI.Visibility = Visibility.Visible;
  407. FileInfoControl.InitWithPDFViewer(pdfViewControl.PDFView);
  408. PopupBorder.Visibility = Visibility.Visible;
  409. }
  410. private void FileInfoCloseBtn_Click(object sender, RoutedEventArgs e)
  411. {
  412. PopupBorder.Visibility = Visibility.Collapsed;
  413. }
  414. private void OpenFile_Click(object sender, RoutedEventArgs e)
  415. {
  416. try
  417. {
  418. string filePath = CommonHelper.GetFilePathOrEmpty();
  419. if (!string.IsNullOrEmpty(filePath) && pdfViewControl != null)
  420. {
  421. passwordViewer = new PDFViewControl();
  422. passwordViewer.PDFView.InitDocument(filePath);
  423. if (passwordViewer.PDFView.Document == null)
  424. {
  425. MessageBox.Show("Open File Failed");
  426. return;
  427. }
  428. if (passwordViewer.PDFView.Document.IsLocked)
  429. {
  430. PasswordUI.SetShowText(System.IO.Path.GetFileName(filePath) + " password encrypted.");
  431. PasswordUI.ClearPassword();
  432. PopupBorder.Visibility = Visibility.Visible;
  433. PasswordUI.Visibility = Visibility.Visible;
  434. }
  435. else
  436. {
  437. pdfViewControl = passwordViewer;
  438. LoadDocument();
  439. }
  440. }
  441. }
  442. catch (Exception ex)
  443. {
  444. }
  445. }
  446. private void SaveFileBtn_Click(object sender, RoutedEventArgs e)
  447. {
  448. if (pdfViewControl != null && pdfViewControl.PDFView != null && pdfViewControl.PDFView.Document != null)
  449. {
  450. try
  451. {
  452. CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
  453. if (pdfDoc.WriteToLoadedPath())
  454. {
  455. return;
  456. }
  457. SaveFileDialog saveDialog = new SaveFileDialog();
  458. saveDialog.Filter = "(*.pdf)|*.pdf";
  459. saveDialog.DefaultExt = ".pdf";
  460. saveDialog.OverwritePrompt = true;
  461. if (saveDialog.ShowDialog() == true)
  462. {
  463. pdfDoc.WriteToFilePath(saveDialog.FileName);
  464. }
  465. }
  466. catch (Exception ex)
  467. {
  468. }
  469. }
  470. }
  471. #region Annotation
  472. public void InitialPDFViewControl(PDFViewControl newPDFViewer)
  473. {
  474. pdfAnnotationControl.SetPDFViewer(newPDFViewer.PDFView);
  475. pdfAnnotationControl.AnnotationCancel();
  476. AnnotationBarControl.ClearAllToolState();
  477. ExpandRightPropertyPanel(null, Visibility.Collapsed);
  478. }
  479. #endregion
  480. private void AnnotationBarControl_Loaded(object sender, RoutedEventArgs e)
  481. {
  482. CPDFAnnotationType[] annotationProperties = { CPDFAnnotationType.Highlight, CPDFAnnotationType.Underline, CPDFAnnotationType.Strikeout, CPDFAnnotationType.Squiggly, CPDFAnnotationType.Freehand, CPDFAnnotationType.FreeText, CPDFAnnotationType.Note, CPDFAnnotationType.Circle, CPDFAnnotationType.Square, CPDFAnnotationType.Arrow, CPDFAnnotationType.Line, CPDFAnnotationType.Stamp, CPDFAnnotationType.Signature, CPDFAnnotationType.Link, CPDFAnnotationType.Audio };
  483. AnnotationBarControl.InitAnnotationBar(annotationProperties);
  484. AnnotationBarControl.AnnotationPropertyChanged += AnnotationBarControl_AnnotationPropertyChanged;
  485. AnnotationBarControl.AnnotationCancel += AnnotationBarControl_AnnotationCancel;
  486. }
  487. private void AnnotationBarControl_Unloaded(object sender, RoutedEventArgs e)
  488. {
  489. AnnotationBarControl.AnnotationPropertyChanged -= AnnotationBarControl_AnnotationPropertyChanged;
  490. AnnotationBarControl.AnnotationCancel -= AnnotationBarControl_AnnotationCancel;
  491. }
  492. private void AnnotationBarControl_AnnotationCancel(object sender, EventArgs e)
  493. {
  494. pdfAnnotationControl.AnnotationCancel();
  495. ExpandRightPropertyPanel(null, Visibility.Collapsed);
  496. }
  497. private void AnnotationBarControl_AnnotationPropertyChanged(object sender, CPDFAnnotationType e)
  498. {
  499. pdfAnnotationControl.LoadAnnotationPanel(e);
  500. ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
  501. }
  502. private void AnnotationBarControl_Click(object sender, RoutedEventArgs e)
  503. {
  504. ToggleButton toggleButton = sender as ToggleButton;
  505. if (toggleButton != null)
  506. {
  507. if (toggleButton.IsChecked == true)
  508. {
  509. if (pdfAnnotationControl != null)
  510. {
  511. ExpandRightPropertyPanel(pdfAnnotationControl, Visibility.Visible);
  512. }
  513. }
  514. else
  515. {
  516. ExpandRightPropertyPanel(null, Visibility.Collapsed);
  517. }
  518. }
  519. }
  520. public void ExpandRightPropertyPanel(UIElement properytPanel, Visibility visible)
  521. {
  522. PropertyContainer.Width = 260;
  523. PropertyContainer.Child = properytPanel;
  524. PropertyContainer.Visibility = visible;
  525. }
  526. }
  527. }