ViewContentViewModel.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. using Microsoft.Win32;
  2. using Prism.Commands;
  3. using Prism.Mvvm;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using ComPDFKitViewer.PdfViewer;
  10. using Prism.Regions;
  11. using DryIoc;
  12. using System.Diagnostics;
  13. using Prism.Services.Dialogs;
  14. using PDF_Office.CustomControl;
  15. using PDF_Office.Model;
  16. using System.Windows;
  17. using System.Windows.Controls;
  18. using System.IO;
  19. namespace PDF_Office.ViewModels
  20. {
  21. public class ViewContentViewModel : BindableBase, INavigationAware
  22. {
  23. #region 属性、变量
  24. private CPDFViewer PDFViewer { get; set; }
  25. private MainContentViewModel mainViewModel { get; set; }
  26. public IRegionManager region;
  27. public IDialogService dialogs;
  28. public string ViwerRegionName { get; set; }
  29. public string BOTARegionName { get; set; }
  30. public string PropertyRegionName { get; set; }
  31. public string ToolContentRegionName { get; set; }
  32. public string ToolsBarContentRegionName { get; set; }
  33. /// <summary>
  34. /// 是否处于页面编辑模式,用于执行undo redo 的具体操作
  35. /// </summary>
  36. public bool isInPageEdit = false;
  37. public Action PageEditUndo { get; set; }
  38. public Action PageEditRedo { get; set; }
  39. /// <summary>
  40. /// 提示对话框对象
  41. /// </summary>
  42. private AlertsMessage alertsMessage = new AlertsMessage();
  43. private int gridToolRow = 1;
  44. /// <summary>
  45. /// 控制ToolContent的Row
  46. /// </summary>
  47. public int GridToolRow
  48. {
  49. get { return gridToolRow; }
  50. set
  51. {
  52. SetProperty(ref gridToolRow, value);
  53. }
  54. }
  55. private int gridToolRowSpan = 3;
  56. /// <summary>
  57. /// 控制ToolContent的RowSpan
  58. /// </summary>
  59. public int GridToolRowSpan
  60. {
  61. get { return gridToolRowSpan; }
  62. set
  63. {
  64. SetProperty(ref gridToolRowSpan, value);
  65. }
  66. }
  67. private Visibility toolContentVisible = Visibility.Collapsed;
  68. /// <summary>
  69. /// 控制Content的显示 用于显示水印、贝茨码、密文等功能模块
  70. /// 留意:显示前需要先注入内容、设置好行和跨行数
  71. /// </summary>
  72. public Visibility ToolContentVisible
  73. {
  74. get { return toolContentVisible; }
  75. set
  76. {
  77. SetProperty(ref toolContentVisible, value);
  78. }
  79. }
  80. private Visibility isLoading = Visibility.Collapsed;
  81. /// <summary>
  82. /// 是否正在加载中
  83. /// </summary>
  84. public Visibility IsLoading
  85. {
  86. get { return isLoading; }
  87. set
  88. {
  89. SetProperty(ref isLoading, value);
  90. }
  91. }
  92. private Visibility toolsbarContentVisible = Visibility.Collapsed;
  93. /// <summary>
  94. /// 控制ToolsBarContent的显示
  95. /// 留意:显示前需要先注入内容、设置好行和跨行数
  96. /// </summary>
  97. public Visibility ToolsBarContentVisible
  98. {
  99. get { return toolsbarContentVisible; }
  100. set
  101. {
  102. SetProperty(ref toolsbarContentVisible, value);
  103. }
  104. }
  105. private bool canSave;
  106. /// <summary>
  107. /// 是否可以保存
  108. /// </summary>
  109. public bool CanSave
  110. {
  111. get { return canSave; }
  112. set
  113. {
  114. SetProperty(ref canSave, value);
  115. }
  116. }
  117. private bool canUndo;
  118. public bool CanUndo
  119. {
  120. get { return canUndo; }
  121. set
  122. {
  123. SetProperty(ref canUndo, value);
  124. }
  125. }
  126. private bool canRedo;
  127. public bool CanRedo
  128. {
  129. get { return canRedo; }
  130. set
  131. {
  132. SetProperty(ref canRedo, value);
  133. }
  134. }
  135. private Dictionary<string, string> regionNameByTabItem;
  136. private Dictionary<string, string> barContentByTabItem;
  137. private string previousBar = "";
  138. private string currentBar = "";
  139. /// <summary>
  140. /// 用来避免重复触发导航事件的标志符
  141. /// </summary>
  142. private bool isOpenFile = false;
  143. /// <summary>
  144. /// 鼠标滚轮缩放的缩放值
  145. /// </summary>
  146. private double[] zoomLevel = { 1.00f, 10, 25, 50, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
  147. #endregion
  148. #region 命令
  149. public DelegateCommand LoadFile { get; set; }
  150. public DelegateCommand Load { get; set; }
  151. public DelegateCommand<object> TabControlSelectionChangedCommand { get; set; }
  152. public DelegateCommand SaveFile { get; set; }
  153. public DelegateCommand SaveAsFile { get; set; }
  154. public DelegateCommand UndoCommand { get; set; }
  155. public DelegateCommand RedoCommand { get; set; }
  156. #endregion
  157. public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService)
  158. {
  159. region = regionManager;
  160. dialogs = dialogService;
  161. LoadFile = new DelegateCommand(loadFile);
  162. Load = new DelegateCommand(LoadControl);
  163. SaveFile = new DelegateCommand(()=> { saveFile(); });
  164. SaveAsFile = new DelegateCommand(() => { saveAsFile(); });
  165. UndoCommand = new DelegateCommand(Undo);
  166. RedoCommand = new DelegateCommand(Redo);
  167. TabControlSelectionChangedCommand = new DelegateCommand<object>(TabControlSelectonChangedEvent);
  168. ViwerRegionName = Guid.NewGuid().ToString();
  169. BOTARegionName = Guid.NewGuid().ToString();
  170. PropertyRegionName = Guid.NewGuid().ToString();
  171. //未显示时无法注册上Region名称
  172. ToolContentVisible = Visibility.Visible;
  173. ToolContentRegionName = Guid.NewGuid().ToString();
  174. ToolsBarContentRegionName = Guid.NewGuid().ToString();
  175. ToolContentVisible = Visibility.Collapsed;
  176. ToolsBarContentVisible = Visibility.Collapsed;
  177. regionNameByTabItem = new Dictionary<string, string>();
  178. barContentByTabItem = new Dictionary<string, string>();
  179. InitialregionNameByTabItem(ref regionNameByTabItem);
  180. InitialbarContentByTabItem(ref barContentByTabItem);
  181. }
  182. private void InitialregionNameByTabItem(ref Dictionary<string, string> dictionary)
  183. {
  184. dictionary.Add("TabItemPageEdit", ToolContentRegionName);
  185. dictionary.Add("TabItemTool", ToolsBarContentRegionName);
  186. //其他工具菜单栏共用一个ToolsBarContentRegionName
  187. dictionary.Add("TabItemAnnotation", ToolsBarContentRegionName);
  188. dictionary.Add("TabItemConvert", ToolsBarContentRegionName);
  189. dictionary.Add("TabItemScan", ToolsBarContentRegionName);
  190. dictionary.Add("TabItemEdit", ToolsBarContentRegionName);
  191. dictionary.Add("TabItemForm", ToolsBarContentRegionName);
  192. dictionary.Add("TabItemFill", ToolsBarContentRegionName);
  193. }
  194. private void InitialbarContentByTabItem(ref Dictionary<string, string> dictionary)
  195. {
  196. dictionary.Add("TabItemPageEdit", "PageEditContent");
  197. dictionary.Add("TabItemTool", "ToolsBarContent");
  198. dictionary.Add("TabItemAnnotation", "");
  199. dictionary.Add("TabItemConvert", "");
  200. dictionary.Add("TabItemScan", "");
  201. dictionary.Add("TabItemEdit", "");
  202. dictionary.Add("TabItemForm", "");
  203. dictionary.Add("TabItemFill", "");
  204. }
  205. private void UndoManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
  206. {
  207. if (e.PropertyName == "CanSave")
  208. {
  209. CanSave = PDFViewer.UndoManager.CanSave;
  210. }
  211. if(e.PropertyName == "CanUndo")
  212. {
  213. CanUndo = PDFViewer.UndoManager.CanUndo;
  214. }
  215. if(e.PropertyName =="CanRedo")
  216. {
  217. CanRedo = PDFViewer.UndoManager.CanRedo;
  218. }
  219. }
  220. /// <summary>
  221. /// 选项卡切换事件
  222. /// </summary>
  223. /// <param name="e"></param>
  224. private void TabControlSelectonChangedEvent(object e)
  225. {
  226. var args = e as SelectionChangedEventArgs;
  227. if (args != null)
  228. {
  229. var item = args.AddedItems[0] as TabItem;
  230. currentBar = item.Name;
  231. if (previousBar != currentBar)
  232. {
  233. if(currentBar== "TabItemPageEdit")//如果是页面编辑则进入页面编辑模式
  234. {
  235. EnterToolMode(barContentByTabItem[currentBar]);
  236. isInPageEdit = true;
  237. }
  238. else//其余情况直接导航至对应的工具栏即可,不需要清空之前的content,region里是单例模式
  239. {
  240. EnterSelectedBar(currentBar);
  241. isInPageEdit = false;
  242. }
  243. previousBar = currentBar;
  244. }
  245. }
  246. }
  247. #region PDFViewer鼠标滚轮缩放事件
  248. public void PdfViewer_MouseWheelZoomHandler(object sender, bool e)
  249. {
  250. double newZoom = CheckZoomLevel(PDFViewer.ZoomFactor + (e ? 0.01 : -0.01), e);
  251. PDFViewer.Zoom(newZoom);
  252. }
  253. private double CheckZoomLevel(double zoom, bool IsGrowth)
  254. {
  255. double standardZoom = 100;
  256. if (zoom <= 0.01)
  257. {
  258. return 0.01;
  259. }
  260. if (zoom >= 10)
  261. {
  262. return 10;
  263. }
  264. zoom *= 100;
  265. for (int i = 0; i < zoomLevel.Length - 1; i++)
  266. {
  267. if (zoom > zoomLevel[i] && zoom <= zoomLevel[i + 1] && IsGrowth)
  268. {
  269. standardZoom = zoomLevel[i + 1];
  270. break;
  271. }
  272. if (zoom >= zoomLevel[i] && zoom < zoomLevel[i + 1] && !IsGrowth)
  273. {
  274. standardZoom = zoomLevel[i];
  275. break;
  276. }
  277. }
  278. return standardZoom / 100;
  279. }
  280. #endregion
  281. #region Navigate
  282. public void OnNavigatedTo(NavigationContext navigationContext)
  283. {
  284. if (isOpenFile)
  285. return;
  286. var mainVM = navigationContext.Parameters[ParameterNames.MainViewModel] as MainContentViewModel;
  287. if (mainVM != null)
  288. {
  289. mainViewModel = mainVM;
  290. }
  291. var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
  292. if (pdfview != null)
  293. {
  294. PDFViewer = pdfview;
  295. loadFile();
  296. }
  297. isOpenFile = true;
  298. }
  299. public bool IsNavigationTarget(NavigationContext navigationContext)
  300. {
  301. return true;
  302. }
  303. public void OnNavigatedFrom(NavigationContext navigationContext)
  304. {
  305. }
  306. #endregion
  307. #region 方法
  308. private void Undo()
  309. {
  310. if(isInPageEdit)
  311. {
  312. //执行页面编辑的Undo
  313. PageEditUndo?.Invoke();
  314. }
  315. else
  316. {
  317. PDFViewer.UndoManager.Undo();
  318. }
  319. }
  320. private void Redo()
  321. {
  322. if(isInPageEdit)
  323. {
  324. //执行页面编辑的Redo
  325. PageEditRedo?.Invoke();
  326. }
  327. else
  328. {
  329. PDFViewer.UndoManager.Redo();
  330. }
  331. }
  332. private void LoadControl()
  333. {
  334. //在构造函数中使用Region需要借助Dispatcher 确保UI已经加载完成,加载BOTA区域
  335. System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
  336. {
  337. region.RequestNavigate(BOTARegionName, "BOTAContent");
  338. }
  339. ));
  340. }
  341. /// <summary>
  342. /// 将PDFViwer添加到Region
  343. /// </summary>
  344. private void loadFile()
  345. {
  346. PDFViewer.MouseWheelZoomHandler += PdfViewer_MouseWheelZoomHandler;
  347. PDFViewer.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
  348. CanSave = PDFViewer.UndoManager.CanSave;
  349. CanUndo = PDFViewer.UndoManager.CanUndo;
  350. CanRedo = PDFViewer.UndoManager.CanRedo;
  351. region.AddToRegion(ViwerRegionName, PDFViewer);
  352. }
  353. /// <summary>
  354. /// 已有路径文档的保存逻辑
  355. /// </summary>
  356. private bool saveFile()
  357. {
  358. try
  359. {
  360. if (string.IsNullOrEmpty(PDFViewer.Document.FilePath))
  361. return saveAsFile();
  362. //文档已被修复时 提示另存为
  363. if (PDFViewer.Document.HasRepaired)
  364. {
  365. alertsMessage.ShowDialog("", "文件已被修复,建议另存为", "Cancel", "OK");
  366. if (alertsMessage.result == ContentResult.Ok)
  367. return saveAsFile();
  368. else
  369. return false;
  370. }
  371. //文件路径无法存在时
  372. if (!File.Exists(PDFViewer.Document.FilePath))
  373. {
  374. alertsMessage.ShowDialog("", "文件路径不存在,需要另存为", "Cancel", "OK");
  375. if (alertsMessage.result == ContentResult.Ok)
  376. return saveAsFile();
  377. else
  378. return false;
  379. }
  380. //只读文件无法写入时,提示另存为
  381. FileInfo fileInfo = new FileInfo(PDFViewer.Document.FilePath);
  382. if (fileInfo.IsReadOnly)
  383. {
  384. alertsMessage.ShowDialog("", "文件为只读文件,需要另存为", "Cancel", "OK");
  385. if (alertsMessage.result == ContentResult.Ok)
  386. return saveAsFile();
  387. else
  388. return false;
  389. }
  390. bool result = PDFViewer.Document.WriteToLoadedPath();
  391. if (result)
  392. {
  393. PDFViewer.UndoManager.CanSave = false;
  394. App.Current.Dispatcher.Invoke(() =>
  395. {
  396. //TODO:更新缩略图
  397. //OpenFileInfo info = SettingHelper.GetFileInfo(PdfViewer.Document.FilePath);
  398. //try
  399. //{
  400. // if (!string.IsNullOrEmpty(info.ThumbImgPath) && !PdfViewer.Document.IsEncrypted)//加密的文档不获取缩略图
  401. // {
  402. // var size = PdfViewer.Document.GetPageSize(0);
  403. // System.Drawing.Bitmap bitmap = ToolMethod.RenderPageBitmapNoWait(PdfViewer.Document, (int)size.Width, (int)size.Height, 0, true, true);
  404. // string folderPath = System.IO.Path.Combine(App.CurrentPath, "CoverImage");
  405. // if (File.Exists(folderPath))
  406. // File.Delete(folderPath);
  407. // DirectoryInfo folder = new DirectoryInfo(folderPath);
  408. // if (!folder.Exists)
  409. // folder.Create();
  410. // string imagePath = info.ThumbImgPath;
  411. // if (!File.Exists(imagePath))//由加密文档变为非加密文档时 新建一个路径
  412. // {
  413. // string imageName = Guid.NewGuid().ToString();
  414. // imagePath = System.IO.Path.Combine(folderPath, imageName);
  415. // using (FileStream stream = new FileStream(imagePath, FileMode.Create))
  416. // {
  417. // bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
  418. // }
  419. // }
  420. // else
  421. // {
  422. // using (FileStream stream = new FileStream(imagePath, FileMode.Open))
  423. // {
  424. // bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
  425. // }
  426. // }
  427. // info.ThumbImgPath = imagePath;
  428. // SettingHelper.SetFileInfo(info);
  429. // }
  430. //}
  431. //catch
  432. //{
  433. // info.ThumbImgPath = null;
  434. // SettingHelper.SetFileInfo(info);
  435. //}
  436. });
  437. }
  438. else
  439. {
  440. //文件被占用 保存失败时
  441. alertsMessage.ShowDialog("", "文件被占用,需要另存为", "Cancel", "OK");
  442. if (alertsMessage.result == ContentResult.Ok)
  443. return saveAsFile();
  444. else
  445. return false;
  446. }
  447. return result;
  448. }
  449. catch { return false; }
  450. }
  451. /// <summary>
  452. /// 另存为或新文档保存逻辑
  453. /// </summary>
  454. private bool saveAsFile()
  455. {
  456. var dlg = new SaveFileDialog();
  457. dlg.Filter = Properties.Resources.OpenDialogFilter;
  458. dlg.FileName = PDFViewer.Document.FileName;
  459. if (dlg.ShowDialog() == true && !string.IsNullOrEmpty(dlg.FileName))
  460. {
  461. bool result = false;
  462. if (App.OpenedFileList.Contains(dlg.FileName))
  463. {
  464. //提示文件已经被打开
  465. }
  466. else
  467. {
  468. result = PDFViewer.Document.WriteToFilePath(dlg.FileName);
  469. if (result)
  470. {
  471. DoAfterSaveAs(dlg.FileName);
  472. }
  473. else
  474. {
  475. //提示文件被其他软件占用 无法保存
  476. //MessageBoxEx.Show(App.MainPageLoader.GetString("Main_TheFileOccupiedWarning"), "", Winform.MessageBoxButtons.OKCancel, new string[] { App.MainPageLoader.GetString("Main_SaveAs"), App.MainPageLoader.GetString("Main_Cancel") })
  477. }
  478. ;
  479. }
  480. return result;
  481. }
  482. else
  483. return false;
  484. }
  485. /// <summary>
  486. /// 另存为后进行的操作
  487. /// 重新打开新文档
  488. /// </summary>
  489. /// <param name="targetPath"></param>
  490. public void DoAfterSaveAs(string targetPath)
  491. {
  492. App.OpenedFileList.Remove(targetPath);
  493. string oldFilePath = targetPath;
  494. PDFViewer.UndoManager.CanSave = false;
  495. mainViewModel.OpenFile(targetPath);
  496. //TODO:通知各模块更新PDFview对象
  497. //var result = OpenFile(targetPath, true);
  498. //if (result)
  499. //{
  500. // FileChanged.Invoke(this, null);
  501. // Zoomer.PdfViewer = PdfViewer;
  502. // PageSelector.PdfViewer = PdfViewer;
  503. // ViewModeSelector.PdfViewer = PdfViewer;
  504. // OpenFileInfo fileInfo = SettingHelper.GetFileInfo(oldFilePath);
  505. // if (fileInfo != null)
  506. // {
  507. // PdfViewer.ChangeViewMode(fileInfo.LastViewMode);
  508. // PdfViewer.ChangeFitMode(fileInfo.LastFitMode);
  509. // if (fileInfo.LastFitMode == FitMode.FitFree)
  510. // PdfViewer.Zoom(fileInfo.LastZoom);
  511. // PdfViewer.GoToPage(fileInfo.LastPageIndex);
  512. // if (fileInfo.LastDrawMode == DrawModes.Draw_Mode_Custom && fileInfo.LastFillColor != 0)
  513. // PdfViewer.SetDrawMode(fileInfo.LastDrawMode, fileInfo.LastFillColor);
  514. // else
  515. // PdfViewer.SetDrawMode(fileInfo.LastDrawMode);
  516. // }
  517. //}
  518. }
  519. /// <summary>
  520. /// 显示前添加内容到Region
  521. /// </summary>
  522. /// <param name="isPageEdit"></param>
  523. private void ShowContent(string currentBar,bool isToolMode=false)
  524. {
  525. //显示页面编辑或其他工具
  526. if (currentBar == "TabItemPageEdit"||isToolMode)
  527. {
  528. if (currentBar == "TabItemPageEdit")//进入页面编辑
  529. {
  530. if (GridToolRow != 1)
  531. {
  532. GridToolRow = 1;
  533. }
  534. if (GridToolRowSpan != 3)
  535. {
  536. GridToolRowSpan = 3;
  537. }
  538. }
  539. else//进入水印等其他工具模式
  540. {
  541. if (GridToolRow != 0)
  542. {
  543. GridToolRow = 0;
  544. }
  545. if (GridToolRowSpan != 4)
  546. {
  547. GridToolRowSpan = 4;
  548. }
  549. }
  550. //ToolContent的visible跟toolsbarContent 的visible是互斥的
  551. ToolContentVisible = Visibility.Visible;
  552. ToolsBarContentVisible = Visibility.Collapsed;
  553. }
  554. else
  555. {
  556. if (GridToolRow != 1)
  557. {
  558. GridToolRow = 1;
  559. }
  560. ToolContentVisible = Visibility.Collapsed;
  561. ToolsBarContentVisible = Visibility.Visible;
  562. }
  563. }
  564. /// <summary>
  565. /// 进入工具编辑(如页面编辑、水印、密文等)模式
  566. /// </summary>
  567. /// <param name="targetToolMode">要导航过去的控件名称</param>
  568. /// <param name="valuePairs">导航需要传送的参数,为空时,默认传送PDFView和ViewContentViewModel</param>
  569. private async void EnterToolMode(string targetToolMode, NavigationParameters valuePairs = null)
  570. {
  571. IsLoading = Visibility.Visible;
  572. await Task.Delay(3);
  573. NavigationParameters param = new NavigationParameters();
  574. if (valuePairs == null)
  575. {
  576. param.Add(ParameterNames.PDFViewer, PDFViewer);
  577. param.Add(ParameterNames.ViewContentViewModel, this);
  578. }
  579. else//有传入其他内容的参数时
  580. {
  581. param = valuePairs;
  582. }
  583. region.RequestNavigate(ToolContentRegionName, targetToolMode, param);
  584. ShowContent(currentBar,true);
  585. IsLoading = Visibility.Collapsed;
  586. }
  587. private void EnterSelectedBar(string currentBar)
  588. {
  589. NavigationParameters param = new NavigationParameters();
  590. param.Add(ParameterNames.PDFViewer, PDFViewer);
  591. param.Add(ParameterNames.ViewContentViewModel, this);
  592. region.RequestNavigate(regionNameByTabItem[currentBar], barContentByTabItem[currentBar], param);
  593. ShowContent(currentBar);
  594. }
  595. /// <summary>
  596. /// 退出工具(水印、密文等)编辑模式,隐藏ToolContent
  597. /// </summary>
  598. public void ExitToolMode()
  599. {
  600. ToolContentVisible = Visibility.Collapsed;
  601. }
  602. #endregion
  603. }
  604. }