MeasureControl.xaml.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. using ComPDFKit.Measure;
  2. using ComPDFKit.PDFAnnotation;
  3. using ComPDFKit.Tool;
  4. using Compdfkit_Tools.Helper;
  5. using Compdfkit_Tools.PDFControl;
  6. using ComPDFKitViewer;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Diagnostics;
  11. using System.Drawing;
  12. using System.Globalization;
  13. using System.IO;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Threading.Tasks;
  17. using System.Windows;
  18. using System.Windows.Controls;
  19. using System.Windows.Data;
  20. using System.Windows.Documents;
  21. using System.Windows.Input;
  22. using System.Windows.Media;
  23. using System.Windows.Media.Imaging;
  24. using System.Windows.Navigation;
  25. using System.Windows.Shapes;
  26. using ComPDFKit.PDFPage;
  27. using ComPDFKit.Tool.Help;
  28. using ComPDFKit.Viewer.Annot;
  29. using ComPDFKitViewer.BaseObject;
  30. using Path = System.IO.Path;
  31. namespace Compdfkit_Tools.Measure
  32. {
  33. /// <summary>
  34. /// MeasureControl.xaml 的交互逻辑
  35. /// </summary>
  36. public partial class MeasureControl : UserControl
  37. {
  38. public MeasurePropertyControl measurePropertyControl = new MeasurePropertyControl();
  39. private CPDFDisplaySettingsControl displaySettingsControl;
  40. private PDFViewControl PdfViewControl = new PDFViewControl();
  41. private PanelState panelState = PanelState.GetInstance();
  42. private CPDFAnnotation currentAnnot = null;
  43. public event EventHandler ExpandEvent;
  44. public event EventHandler OnAnnotEditHandler;
  45. public MeasureControl()
  46. {
  47. InitializeComponent();
  48. }
  49. #region Init PDFViewer
  50. public void InitWithPDFViewer(PDFViewControl pdfViewControl)
  51. {
  52. PdfViewControl = pdfViewControl;
  53. //PdfViewControl.PDFView = pdfViewer;
  54. PDFMeasureTool.InitWithPDFViewer(pdfViewControl, measurePropertyControl, this);
  55. FloatPageTool.InitWithPDFViewer(pdfViewControl);
  56. PDFGrid.Child = PdfViewControl;
  57. panelState.PropertyChanged -= PanelState_PropertyChanged;
  58. PdfViewControl.MouseLeftButtonDownHandler -= PDFToolManager_MouseLeftButtonDownHandler;
  59. PdfViewControl.MouseLeftButtonUpHandler -= PDFToolManager_MouseLeftButtonUpHandler;
  60. PdfViewControl.MouseMoveHandler -= PDFToolManager_MouseMoveHandler;
  61. pdfViewControl.MouseRightButtonDownHandler -= PDFToolManager_MouseRightButtonDownHandler;
  62. PdfViewControl.PDFViewTool.MeasureChanged -= MeasureSetting_MeasureChanged;
  63. PdfViewControl.PDFViewTool.MeasureChanged += MeasureSetting_MeasureChanged;
  64. PdfViewControl.MouseLeftButtonDownHandler += PDFToolManager_MouseLeftButtonDownHandler;
  65. PdfViewControl.MouseLeftButtonUpHandler += PDFToolManager_MouseLeftButtonUpHandler;
  66. PdfViewControl.MouseMoveHandler += PDFToolManager_MouseMoveHandler;
  67. pdfViewControl.MouseRightButtonDownHandler += PDFToolManager_MouseRightButtonDownHandler;
  68. panelState.PropertyChanged += PanelState_PropertyChanged;
  69. SetInfoPanelVisble(false, false);
  70. SettingPanel.PdfViewControl= pdfViewControl;
  71. }
  72. private void MeasureSetting_MeasureChanged(object sender, MeasureEventArgs e)
  73. {
  74. InfoPanel.SetMeasureType(e.Type);
  75. InfoPanel.SetMeasureInfo(e);
  76. }
  77. private void PDFToolManager_MouseRightButtonDownHandler(object sender, MouseEventObject e)
  78. {
  79. ContextMenu ContextMenu = PdfViewControl.GetRightMenu();
  80. if (ContextMenu == null)
  81. {
  82. ContextMenu = new ContextMenu();
  83. }
  84. switch (e.hitTestType)
  85. {
  86. case MouseHitTestType.Annot:
  87. case MouseHitTestType.SelectRect:
  88. CreateAnnotContextMenu(sender, ref ContextMenu, e.annotType);
  89. break;
  90. case MouseHitTestType.Text:
  91. CreateSelectTextContextMenu(sender, ref ContextMenu);
  92. break;
  93. case MouseHitTestType.ImageSelect:
  94. CreateSelectImageContextMenu(sender, ref ContextMenu);
  95. break;
  96. default:
  97. ContextMenu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Paste"), Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  98. PdfViewControl.CreateViewerMenu(sender, ref ContextMenu);
  99. break;
  100. }
  101. PdfViewControl.SetRightMenu(ContextMenu);
  102. }
  103. private void CreateAnnotContextMenu(object sender, ref ContextMenu menu, C_ANNOTATION_TYPE annotType)
  104. {
  105. switch (annotType)
  106. {
  107. case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
  108. case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
  109. case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
  110. CreateMeasureContextMenu(sender, ref menu);
  111. break;
  112. case C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET:
  113. break;
  114. case C_ANNOTATION_TYPE.C_ANNOTATION_SOUND:
  115. case C_ANNOTATION_TYPE.C_ANNOTATION_MOVIE:
  116. case C_ANNOTATION_TYPE.C_ANNOTATION_RICHMEDIA:
  117. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Delete"), Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  118. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Play"), Command = MediaCommands.Play, CommandTarget = (UIElement)sender, CommandParameter = (sender as CPDFViewerTool).GetCacheHitTestAnnot() });
  119. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Cut"), Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
  120. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Paste"), Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  121. break;
  122. default:
  123. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Delete"), Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  124. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Copy"), Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
  125. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Cut"), Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
  126. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Paste"), Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
  127. break;
  128. }
  129. }
  130. private void CreateMeasureContextMenu(object sender, ref ContextMenu menu)
  131. {
  132. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Delete"), Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
  133. MenuItem menuItem = new MenuItem();
  134. menuItem.Header = "Measurement Settings";
  135. menuItem.Click += (item, param) =>
  136. {
  137. if (currentAnnot is CPDFLineAnnotation annotation)
  138. {
  139. SettingPanel.BindMeasureSetting(annotation.GetDistanceMeasure().MeasureInfo);
  140. }
  141. SetInfoPanelVisble(false, true);
  142. };
  143. menu.Items.Add(menuItem);
  144. MenuItem propertyItem = new MenuItem();
  145. propertyItem.Header = "Properties";
  146. propertyItem.Click += (item, param) =>
  147. {
  148. panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
  149. };
  150. menu.Items.Add(propertyItem);
  151. }
  152. private void CreateSelectTextContextMenu(object sender, ref ContextMenu menu)
  153. {
  154. menu.Items.Add(new MenuItem() { Header = LanguageHelper.CommonManager.GetString("Menu_Copy"), Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
  155. }
  156. private void CreateSelectImageContextMenu(object sender, ref ContextMenu menu)
  157. {
  158. if (menu == null)
  159. {
  160. menu = new ContextMenu();
  161. }
  162. MenuItem copyImage = new MenuItem();
  163. copyImage.Header = "Copy Image";
  164. copyImage.Click += CopyImage_Click;
  165. menu.Items.Add(copyImage);
  166. MenuItem extractImage = new MenuItem();
  167. extractImage.Header = "Extract Image";
  168. extractImage.Click += ExtractImage_Click;
  169. menu.Items.Add(extractImage);
  170. }
  171. private void ExtractImage_Click(object sender, RoutedEventArgs e)
  172. {
  173. System.Windows.Forms.FolderBrowserDialog folderDialog = new System.Windows.Forms.FolderBrowserDialog();
  174. if (folderDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  175. {
  176. var image = PdfViewControl.FocusPDFViewTool.GetSelectImage();
  177. if (image == null)
  178. {
  179. return;
  180. }
  181. CPDFPage page = PdfViewControl.PDFToolManager.GetDocument().PageAtIndex(image.PageIndex);
  182. string savePath = System.IO.Path.Combine(folderDialog.SelectedPath, Guid.NewGuid() + ".jpg");
  183. string tempPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), Guid.NewGuid() + ".jpg");
  184. page.GetImgSelection().GetImgBitmap(image.ImageIndex, tempPath);
  185. Bitmap bitmap = new Bitmap(tempPath);
  186. bitmap.Save(savePath, System.Drawing.Imaging.ImageFormat.Jpeg);
  187. Process.Start("explorer", "/select,\"" + savePath + "\"");
  188. }
  189. }
  190. private void CopyImage_Click(object sender, RoutedEventArgs e)
  191. {
  192. var image = PdfViewControl.FocusPDFViewTool.GetSelectImage();
  193. if (image == null)
  194. {
  195. return;
  196. }
  197. CPDFPage page = PdfViewControl.PDFToolManager.GetDocument().PageAtIndex(image.PageIndex);
  198. string tempPath = System.IO.Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".jpg");
  199. page.GetImgSelection().GetImgBitmap(image.ImageIndex, tempPath);
  200. Bitmap bitmap = new Bitmap(tempPath);
  201. BitmapImage imageData;
  202. using (MemoryStream ms = new MemoryStream())
  203. {
  204. bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
  205. imageData = new BitmapImage();
  206. imageData.BeginInit();
  207. imageData.StreamSource = ms;
  208. imageData.CacheOption = BitmapCacheOption.OnLoad;
  209. imageData.EndInit();
  210. imageData.Freeze();
  211. Clipboard.SetImage(imageData);
  212. bitmap.Dispose();
  213. File.Delete(tempPath);
  214. }
  215. }
  216. private void PDFToolManager_MouseMoveHandler(object sender, MouseEventObject e)
  217. {
  218. }
  219. private void PDFToolManager_MouseLeftButtonUpHandler(object sender, MouseEventObject e)
  220. {
  221. if (e.IsCreate)
  222. {
  223. OnAnnotEditHandler?.Invoke(this, EventArgs.Empty);
  224. }
  225. }
  226. private void PDFToolManager_MouseLeftButtonDownHandler(object sender, MouseEventObject e)
  227. {
  228. BaseAnnot baseAnnot = PdfViewControl.GetCacheHitTestAnnot();
  229. if (baseAnnot != null)
  230. {
  231. AnnotData annotData = baseAnnot.GetAnnotData();
  232. AnnotParam annotParam = ParamConverter.CPDFDataConverterToAnnotParam(
  233. PdfViewControl.GetCPDFViewer().GetDocument(), annotData.PageIndex, annotData.Annot);
  234. measurePropertyControl.SetPropertyForMeasureCreate(annotParam, annotData.Annot, PdfViewControl);
  235. SetMeasureInfoPanel(annotData.Annot, annotParam);
  236. currentAnnot = annotData.Annot;
  237. }
  238. panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
  239. // measurePropertyControl.SetPropertyForMeasureCreate(LineArgs, e);
  240. SetInfoPanelVisble(true, false);
  241. }
  242. private void SetMeasureInfoPanel(CPDFAnnotation annot,AnnotParam param = null)
  243. {
  244. if (annot == null)
  245. {
  246. return;
  247. }
  248. try
  249. {
  250. if (annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
  251. {
  252. CPDFLineAnnotation lineAnnot = annot as CPDFLineAnnotation;
  253. if (lineAnnot.IsMersured() && lineAnnot.Points != null && lineAnnot.Points.Count() == 2)
  254. {
  255. InfoPanel.SetMeasureInfo(lineAnnot);
  256. SetMeasureInfoType(CPDFMeasureType.CPDF_DISTANCE_MEASURE);
  257. }
  258. }
  259. if (annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE)
  260. {
  261. CPDFPolylineAnnotation polylineAnnot = annot as CPDFPolylineAnnotation;
  262. if (polylineAnnot.IsMersured() && polylineAnnot.Points != null && polylineAnnot.Points.Count() >= 2)
  263. {
  264. InfoPanel.SetMeasureInfo(polylineAnnot);
  265. SetMeasureInfoType(CPDFMeasureType.CPDF_PERIMETER_MEASURE);
  266. }
  267. }
  268. if(annot.Type== C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON)
  269. {
  270. CPDFPolygonAnnotation Annot = annot as CPDFPolygonAnnotation;
  271. CPDFAreaMeasure polygonMeasure = Annot.GetAreaMeasure();
  272. CPDFMeasureInfo measureInfo = polygonMeasure.MeasureInfo;
  273. CPDFCaptionType CaptionType = measureInfo.CaptionType;
  274. bool IsArea = false;
  275. bool IsLength = false;
  276. if ((CaptionType& CPDFCaptionType.CPDF_CAPTION_AREA)== CPDFCaptionType.CPDF_CAPTION_AREA)
  277. {
  278. IsArea = true;
  279. }
  280. if ((CaptionType & CPDFCaptionType.CPDF_CAPTION_LENGTH) == CPDFCaptionType.CPDF_CAPTION_LENGTH)
  281. {
  282. IsLength = true;
  283. }
  284. SettingPanel.ChangedCheckBoxIsChecked(IsArea, IsLength);
  285. InfoPanel.SetMeasureInfo(Annot);
  286. SetMeasureInfoType(CPDFMeasureType.CPDF_AREA_MEASURE);
  287. }
  288. }
  289. catch (Exception e)
  290. {
  291. }
  292. }
  293. private double GetMeasureRatio(string baseUnit)
  294. {
  295. if (baseUnit == CPDFMeasure.CPDF_PT)
  296. {
  297. return 1 / 72;
  298. }
  299. if (baseUnit == CPDFMeasure.CPDF_IN)
  300. {
  301. return 1;
  302. }
  303. if (baseUnit == CPDFMeasure.CPDF_MM)
  304. {
  305. return 1 / 25.4;
  306. }
  307. if (baseUnit == CPDFMeasure.CPDF_CM)
  308. {
  309. return 1 / 2.54;
  310. }
  311. if (baseUnit == CPDFMeasure.CPDF_M)
  312. {
  313. return 1 / 0.0254;
  314. }
  315. if (baseUnit == CPDFMeasure.CPDFO_KM)
  316. {
  317. return 1 / 0.0254 / 1000;
  318. }
  319. if (baseUnit == CPDFMeasure.CPDF_FT)
  320. {
  321. return 12;
  322. }
  323. if (baseUnit == CPDFMeasure.CPDF_YD)
  324. {
  325. return 36;
  326. }
  327. if (baseUnit == CPDFMeasure.CPDF_MI)
  328. {
  329. return 63360;
  330. }
  331. return 0;
  332. }
  333. public void SetSettingsControl(CPDFDisplaySettingsControl cPDFDisplaySettingsControl)
  334. {
  335. displaySettingsControl = cPDFDisplaySettingsControl;
  336. }
  337. public void ClearAllToolState()
  338. {
  339. PDFMeasureTool.ClearAllToolState();
  340. InfoPanel.ClearMeasureInfo();
  341. }
  342. public void ClearViewerControl()
  343. {
  344. PDFGrid.Child = null;
  345. BotaContainer.Child = null;
  346. PropertyContainer.Child = null;
  347. displaySettingsControl = null;
  348. }
  349. public void UnloadEvent()
  350. {
  351. PdfViewControl.MouseLeftButtonDownHandler -= PDFToolManager_MouseLeftButtonDownHandler;
  352. PdfViewControl.MouseLeftButtonUpHandler -= PDFToolManager_MouseLeftButtonUpHandler;
  353. PdfViewControl.MouseMoveHandler -= PDFToolManager_MouseMoveHandler;
  354. panelState.PropertyChanged -= PanelState_PropertyChanged;
  355. }
  356. private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
  357. {
  358. if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
  359. {
  360. ExpandLeftPanel(panelState.IsLeftPanelExpand);
  361. }
  362. else if (e.PropertyName == nameof(PanelState.RightPanel))
  363. {
  364. if (panelState.RightPanel == PanelState.RightPanelState.PropertyPanel)
  365. {
  366. ExpandRightPropertyPanel(measurePropertyControl, Visibility.Visible);
  367. }
  368. else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
  369. {
  370. ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
  371. }
  372. else
  373. {
  374. ExpandRightPropertyPanel(null, Visibility.Collapsed);
  375. }
  376. }
  377. }
  378. #endregion
  379. #region Expand and collapse Panel
  380. public void ExpandRightPropertyPanel(Visibility visible)
  381. {
  382. ExpandRightPropertyPanel(measurePropertyControl, visible);
  383. }
  384. public void ExpandNullRightPropertyPanel(Visibility visible)
  385. {
  386. ExpandRightPropertyPanel(null, visible);
  387. }
  388. public void ExpandViewSettings(Visibility visible)
  389. {
  390. SetViewSettings(displaySettingsControl, visible);
  391. }
  392. private void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
  393. {
  394. PropertyContainer.Width = 260;
  395. PropertyContainer.Child = propertytPanel;
  396. PropertyContainer.Visibility = visible;
  397. }
  398. private void SetViewSettings(CPDFDisplaySettingsControl displaySettingsControl, Visibility visibility)
  399. {
  400. PropertyContainer.Child = displaySettingsControl;
  401. PropertyContainer.Visibility = visibility;
  402. }
  403. public void ExpandLeftPanel(bool isExpand)
  404. {
  405. BotaContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  406. Splitter.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
  407. if (isExpand)
  408. {
  409. BodyGrid.ColumnDefinitions[0].Width = new GridLength(320);
  410. BodyGrid.ColumnDefinitions[1].Width = new GridLength(15);
  411. }
  412. else
  413. {
  414. BodyGrid.ColumnDefinitions[0].Width = new GridLength(0);
  415. BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
  416. }
  417. }
  418. #endregion
  419. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  420. {
  421. }
  422. private void MeasureInfoPanel_SettingClick(object sender, EventArgs e)
  423. {
  424. if (sender is MeasureInfoPanel)
  425. {
  426. switch ((sender as MeasureInfoPanel).MeasureType)
  427. {
  428. case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
  429. case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
  430. SettingPanel.ShowAreaAndLength(Visibility.Collapsed);
  431. break;
  432. case CPDFMeasureType.CPDF_AREA_MEASURE:
  433. SettingPanel.ShowAreaAndLength(Visibility.Visible);
  434. break;
  435. default:
  436. break;
  437. }
  438. }
  439. SettingPanel.ReturnToInfoPanel = true;
  440. SetInfoPanelVisble(false, true);
  441. if(currentAnnot != null)
  442. {
  443. AnnotParam annotParam = ParamConverter.CPDFDataConverterToAnnotParam(
  444. PdfViewControl.GetCPDFViewer().GetDocument(), currentAnnot.Page.PageIndex, currentAnnot);
  445. SettingPanel.BindMeasureSetting(GetMeasureInfoFromParam(annotParam));
  446. }
  447. }
  448. private CPDFMeasureInfo GetMeasureInfoFromParam(AnnotParam param)
  449. {
  450. if(param is LineMeasureParam lineParam)
  451. {
  452. return lineParam.measureInfo;
  453. }
  454. if (param is PolyLineMeasureParam polyLineParam)
  455. {
  456. return polyLineParam.measureInfo;
  457. }
  458. if (param is PolygonMeasureParam polygonParam)
  459. {
  460. return polygonParam.measureInfo;
  461. }
  462. return null;
  463. }
  464. private void SettingPanel_CancelEvent(object sender, EventArgs e)
  465. {
  466. SetInfoPanelVisble(SettingPanel.ReturnToInfoPanel, false);
  467. }
  468. private void SettingPanel_DoneEvent(object sender, EventArgs e)
  469. {
  470. SetInfoPanelVisble(SettingPanel.ReturnToInfoPanel, false);
  471. SettingPanel.SaveMeasureSetting(currentAnnot);
  472. InfoPanel.SetMeasureInfo(currentAnnot);
  473. }
  474. public void SetInfoPanelVisble(bool measureInfo, bool measureSetting)
  475. {
  476. InfoPanel.Visibility = measureInfo ? Visibility.Visible : Visibility.Collapsed;
  477. SettingPanel.Visibility = measureSetting ? Visibility.Visible : Visibility.Collapsed;
  478. }
  479. public void SetMeasureInfoType(CPDFMeasureType measureType)
  480. {
  481. InfoPanel?.SetMeasureType(measureType);
  482. }
  483. public void SetBOTAContainer(CPDFBOTABarControl botaControl)
  484. {
  485. this.BotaContainer.Child = botaControl;
  486. }
  487. public void SetMeasureScale(CPDFMeasureType measureType, string scale)
  488. {
  489. InfoPanel?.SetMeasureScale(measureType,scale);
  490. }
  491. }
  492. }