HomePageHeaderFooterDialogViewModel.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. using ComPDFKit.PDFDocument;
  2. using PDF_Office.CustomControl;
  3. using PDF_Office.Helper;
  4. using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
  5. using PDF_Office.Model;
  6. using Prism.Commands;
  7. using Prism.Mvvm;
  8. using Prism.Regions;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Data;
  12. using System.Diagnostics;
  13. using System.IO;
  14. using System.Linq;
  15. using System.Windows;
  16. using System.Windows.Forms;
  17. using Prism.Events;
  18. using ComPDFKitViewer.PdfViewer;
  19. using PDF_Office.EventAggregators;
  20. using PDFSettings;
  21. using PDF_Office.Model.EditTools.HeaderFooter;
  22. namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter
  23. {
  24. public class HomePageHeaderFooterDialogViewModel : BindableBase, INavigationAware
  25. {
  26. #region 参数和属性
  27. private List<string> fileNames;
  28. private CPDFDocument tempDocument;
  29. public string PageNumber = "";
  30. private CPDFHeaderFooter headerFooter;
  31. public IRegionManager headerFooterRegion;
  32. public IEventAggregator eventAggregator;
  33. private CPDFViewer PDFViewer;
  34. public HeaderFooterInfo HeaderFooterInfo;
  35. private ViewContentViewModel viewContentViewModel;
  36. public string TemplateListName = "HomePageHeaderFooterTemplateListContent";
  37. public string CreateName = "HomePageHeaderFooterCreateContent";
  38. public string HeaderFooterType = "HomePageHeaderFooterType";
  39. private string _headerFooterSettingsRegionName;
  40. /// <summary>
  41. /// 属性设置Region
  42. /// </summary>
  43. public string HeaderFooterSettingsRegionName
  44. {
  45. get { return _headerFooterSettingsRegionName; }
  46. set { _headerFooterSettingsRegionName = value; }
  47. }
  48. private Visibility _headerFooterSettingsVisible = Visibility.Visible;
  49. /// <summary>
  50. /// 属性设置Region可见
  51. /// </summary>
  52. public Visibility HeaderFooterSettingsVisible
  53. {
  54. get { return _headerFooterSettingsVisible; }
  55. set { _headerFooterSettingsVisible = value; }
  56. }
  57. public List<int> fileNamesView = new List<int>();
  58. private int fileNamesIndex = 0;
  59. private int FileNameNumber = 0;
  60. private string headerFooterGridIsEnabled = "True";
  61. public string HeaderFooterGridIsEnabled
  62. {
  63. get
  64. {
  65. return headerFooterGridIsEnabled;
  66. }
  67. set
  68. {
  69. SetProperty(ref headerFooterGridIsEnabled, value);
  70. }
  71. }
  72. private string setHeaderFooterGridIsEnabled = "True";
  73. public string SetHeaderFooterGridIsEnabled
  74. {
  75. get
  76. {
  77. return setHeaderFooterGridIsEnabled;
  78. }
  79. set
  80. {
  81. SetProperty(ref setHeaderFooterGridIsEnabled, value);
  82. }
  83. }
  84. private DataTable pdfDataTable = new DataTable();
  85. public DataTable PDFDataTable
  86. {
  87. get { return pdfDataTable; }
  88. set
  89. {
  90. SetProperty(ref pdfDataTable, value);
  91. }
  92. }
  93. private DataTable pdfCurrentDataTable = new DataTable();
  94. public DataTable PDFCurrentDataTable
  95. {
  96. get { return pdfCurrentDataTable; }
  97. set
  98. {
  99. SetProperty(ref pdfCurrentDataTable, value);
  100. }
  101. }
  102. private string removeIsEnable = "False";
  103. public string RemoveIsEnable
  104. {
  105. get { return removeIsEnable; }
  106. set
  107. {
  108. SetProperty(ref removeIsEnable, value);
  109. }
  110. }
  111. private string selectFileName = "False";
  112. public string SelectFileName
  113. {
  114. get { return selectFileName; }
  115. set
  116. {
  117. SetProperty(ref selectFileName, value);
  118. }
  119. }
  120. private string headerFooterRegionName;
  121. public string HeaderFooterRegionName
  122. {
  123. get
  124. {
  125. return headerFooterRegionName;
  126. }
  127. set
  128. {
  129. SetProperty(ref headerFooterRegionName, value);
  130. }
  131. }
  132. private Visibility headerFooterVisible = Visibility.Collapsed;
  133. public Visibility HeaderFooterVisible
  134. {
  135. get { return headerFooterVisible; }
  136. set { SetProperty(ref headerFooterVisible, value); }
  137. }
  138. private Visibility addFileVisibility = Visibility.Hidden;
  139. public Visibility AddFileVisibility
  140. {
  141. get { return addFileVisibility; }
  142. set
  143. {
  144. SetProperty(ref addFileVisibility, value);
  145. RaisePropertyChanged();
  146. }
  147. }
  148. private string createGridSpan = "1";
  149. public string CreateGridSpan
  150. {
  151. get { return createGridSpan; }
  152. set
  153. {
  154. SetProperty(ref createGridSpan, value);
  155. RaisePropertyChanged();
  156. }
  157. }
  158. private Visibility createGridSpanVisibility = Visibility.Visible;
  159. public Visibility CreateGridSpanVisibility
  160. {
  161. get { return createGridSpanVisibility; }
  162. set
  163. {
  164. SetProperty(ref createGridSpanVisibility, value);
  165. RaisePropertyChanged();
  166. }
  167. }
  168. #endregion
  169. #region 委托声明
  170. public DelegateCommand ADDPDFCommand { get; set; }
  171. public DelegateCommand RemovePDFFileCommand { get; set; }
  172. public DelegateCommand CreateCommand { get; set; }
  173. public DelegateCommand ADDPDFFilesCommand { get; set; }
  174. #endregion
  175. public string Unicode = null;
  176. public HomePageHeaderFooterDialogViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
  177. {
  178. this.eventAggregator = eventAggregator;
  179. this.headerFooterRegion = regionManager;
  180. HeaderFooterSettingsRegionName = Guid.NewGuid().ToString();
  181. Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
  182. PDFCurrentDataTable.Columns.Add("FilePageRangeText");
  183. PDFCurrentDataTable.Columns.Add("FilePageRangeSelectIndex");
  184. PDFCurrentDataTable.Columns.Add("IsEvenPageIsEnabled");
  185. PDFCurrentDataTable.Columns.Add("FileState");
  186. PDFDataTable.Columns.Add("FileName");
  187. PDFDataTable.Columns.Add("FilePageRangeText");
  188. PDFDataTable.Columns.Add("FilePageRangeSelectIndex");
  189. PDFDataTable.Columns.Add("IsEvenPageIsEnabled");
  190. PDFDataTable.Columns.Add("FileSize");
  191. PDFDataTable.Columns.Add("FileState");
  192. ADDPDFCommand = new DelegateCommand(addpicture);
  193. ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
  194. RemovePDFFileCommand = new DelegateCommand(removepdffile);
  195. CreateCommand = new DelegateCommand(create);
  196. eventAggregator.GetEvent<EditBatesHeaderFooterTemplateItemEvent>().Subscribe(EditHeaderFooterTemplateItem, e => e.Unicode == Unicode && e.Type == HeaderFooterType);
  197. eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Subscribe(EnterTemplateListOrCreate, e => e.Unicode == Unicode);
  198. }
  199. #region 逻辑函数
  200. public void EditHeaderFooterTemplateItem(BatesHeaderFooterItemUnicode headerfooterItemunicode)
  201. {
  202. BatesHeaderFooterItem headerfooterItem = headerfooterItemunicode.Status;
  203. NavigationParameters param = new NavigationParameters();
  204. param.Add(ParameterNames.PDFViewer, PDFViewer);
  205. param.Add("HeaderFooterItem", headerfooterItem);
  206. headerFooterRegion.RequestNavigate(HeaderFooterSettingsRegionName, CreateName, param);
  207. HeaderFooterSettingsVisible = Visibility.Visible;
  208. CreateGridSpan = "2";
  209. CreateGridSpanVisibility = Visibility.Collapsed;
  210. }
  211. public void EnterTemplateListOrCreate(EnumTemplateListOrCreateUnicode enumTemplateListOrCreateunicode)
  212. {
  213. EnumTemplateListOrCreate enumTemplateListOrCreate = enumTemplateListOrCreateunicode.Status;
  214. if (enumTemplateListOrCreate == EnumTemplateListOrCreate.StatusTemplate)
  215. {
  216. CreateGridSpan = "1";
  217. CreateGridSpanVisibility = Visibility.Visible;
  218. EnterSelectedContent(TemplateListName);
  219. }
  220. else
  221. {
  222. CreateGridSpan = "2";
  223. CreateGridSpanVisibility = Visibility.Collapsed;
  224. EnterSelectedContent(CreateName);
  225. }
  226. }
  227. public void EnterSelectedContent(string SelectedContentName)
  228. {
  229. NavigationParameters param = new NavigationParameters();
  230. param.Add(ParameterNames.PDFViewer, PDFViewer);
  231. param.Add("ViewModel", this);
  232. headerFooterRegion.RequestNavigate(HeaderFooterSettingsRegionName, SelectedContentName, param);
  233. HeaderFooterSettingsVisible = Visibility.Visible;
  234. }
  235. private void create()
  236. {
  237. fileNamesIndex = 0;
  238. HeaderFooterGridIsEnabled = "False";
  239. foreach (var filename in fileNames)
  240. {
  241. FileInfo fileinfo = new FileInfo(filename);
  242. string OutputPath = fileinfo.DirectoryName;
  243. char[] enumerationSeparator = new char[] { ',' };
  244. char[] rangeSeparator = new char[] { '-' };
  245. List<int> PageIndexLists = new List<int>();
  246. CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
  247. if (document == null || document.IsEncrypted)
  248. {
  249. PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
  250. continue;
  251. }
  252. CreateHeaderFooter(document);
  253. document.WriteToFilePath(filename + "_HeaderFooter.pdf");
  254. //if (!CommonHelper.GetPagesInRange(ref PageIndexLists, "1-" + document.PageCount.ToString(), document.PageCount, enumerationSeparator, rangeSeparator))
  255. //{ //TODO
  256. // Trace.WriteLine("输入不对");
  257. // MessageBoxEx.Show("输入不对");
  258. // return;
  259. //}
  260. //document.Release();
  261. PDFDataTable.Rows[fileNamesIndex]["FilePageRangeSelectIndex"] = "2";
  262. PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
  263. PDFCurrentDataTable.Rows[fileNamesIndex]["FilePageRangeText"] = "2";
  264. PDFCurrentDataTable.Rows[fileNamesIndex]["FilePageRangeSelectIndex"] = "2";
  265. PDFCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
  266. fileNamesIndex++;
  267. }
  268. HeaderFooterGridIsEnabled = "True";
  269. }
  270. public void CreateHeaderFooter(CPDFDocument document)
  271. {
  272. if (HeaderFooterInfo != null)
  273. {
  274. //document.(HeaderFooterInfo.TextData, HeaderFooterInfo.margin, HeaderFooterInfo.PageRange, HeaderFooterInfo.StarPagetNumber + 1);
  275. headerFooter = document.GetHeaderFooter();
  276. for (int i = 0; i < 6; i++)
  277. {
  278. headerFooter.SetText(i, HomePageEditHelper.ReverseDate(HeaderFooterInfo.TextData[i].text, document));
  279. headerFooter.SetFontName(i, HeaderFooterInfo.TextData[i].fontName);
  280. headerFooter.SetFontSize(i, HeaderFooterInfo.TextData[i].fontSize);
  281. headerFooter.SetTextColor(i, HeaderFooterInfo.TextData[i].Color);
  282. }
  283. headerFooter.SetPages(getFilePageRange(document, PDFCurrentDataTable.Rows[fileNamesIndex]["FilePageRangeText"].ToString(), PDFCurrentDataTable.Rows[fileNamesIndex]["FilePageRangeSelectIndex"].ToString()));
  284. headerFooter.SetPageOffset(HeaderFooterInfo.StarPagetNumber + 1);
  285. headerFooter.SetMargin(HeaderFooterInfo.margin);
  286. headerFooter.Update();
  287. }
  288. }
  289. #endregion
  290. #region 批量处理逻辑函数
  291. /// <summary>
  292. /// 添加PDF文件
  293. /// </summary>
  294. private void addpicture()
  295. {
  296. FileNameNumber = fileNames.Count;
  297. System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
  298. dlg.Multiselect = true;
  299. dlg.Filter = "PDF|*.pdf;*.PDF;";
  300. if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  301. {
  302. fileNames.AddRange(dlg.FileNames.ToList());
  303. RemoveExcess(ref fileNames);
  304. SetHeaderFooterGridIsEnabled = "True";
  305. AddFileVisibility = Visibility.Collapsed;
  306. updateListview("待确定");
  307. }
  308. }
  309. public void addPDFFiles(string filename)
  310. {
  311. FileNameNumber = fileNames.Count;
  312. fileNames.Add(filename);
  313. RemoveExcess(ref fileNames);
  314. SetHeaderFooterGridIsEnabled = "True";
  315. AddFileVisibility = Visibility.Collapsed;
  316. updateListview("待确定");
  317. }
  318. /// <summary>
  319. /// 删除重复的文件
  320. /// </summary>
  321. public void RemoveExcess(ref List<string> Filenames)
  322. {
  323. List<string> filenames = new List<string>();
  324. foreach (var fileName in Filenames)
  325. {
  326. if (!filenames.Contains(fileName))
  327. {
  328. filenames.Add(fileName);
  329. }
  330. }
  331. Filenames.Clear();
  332. Filenames = filenames;
  333. }
  334. public void removepdffile(int index)
  335. {
  336. fileNames.Remove(fileNames[index]);
  337. if (fileNames.Count < 1)
  338. {
  339. SetHeaderFooterGridIsEnabled = "False";
  340. AddFileVisibility = Visibility.Visible;
  341. }
  342. updateListview("待确定");
  343. }
  344. /// <summary>
  345. /// 添加PDF文件夹
  346. /// </summary>
  347. private void addpicturefiles()
  348. {
  349. FileNameNumber = fileNames.Count;
  350. FolderBrowserDialog dialog = new FolderBrowserDialog();
  351. dialog.Description = "请选择文件路径";
  352. if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  353. {
  354. string foldPath = dialog.SelectedPath;
  355. var apps = System.IO.Directory.GetFiles(foldPath);
  356. foreach (string app in apps)
  357. {
  358. var fi = new FileInfo(app);
  359. if (fi.Extension == ".pdf" || fi.Extension == ".PDF")
  360. {
  361. fileNames.Add(app);
  362. }
  363. }
  364. RemoveExcess(ref fileNames);
  365. updateListview("待确定");
  366. SetHeaderFooterGridIsEnabled = "True";
  367. AddFileVisibility = Visibility.Collapsed;
  368. }
  369. }
  370. /// <summary>
  371. /// 更新listview显示
  372. /// state 状态显示字符串
  373. /// </summary>
  374. public void updateListview(string state)
  375. {
  376. updateCurrentListview();
  377. DataTable pdfdatatable = new DataTable();
  378. pdfdatatable.Columns.Add("FileName");
  379. pdfdatatable.Columns.Add("FilePageRangeText");
  380. pdfdatatable.Columns.Add("FilePageRangeSelectIndex");
  381. pdfdatatable.Columns.Add("IsEvenPageIsEnabled");
  382. pdfdatatable.Columns.Add("FileSize");
  383. pdfdatatable.Columns.Add("FileState");
  384. int datatableindex = 0;
  385. List<int> PageIndexLists = new List<int>();
  386. foreach (var fileName in fileNames)
  387. {
  388. string file_all = fileName;
  389. FileInfo f = new FileInfo(file_all);
  390. string file_size = (((float)f.Length) / 1024).ToString() + " K";
  391. if (!isEvenPage(fileName) && PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "2")
  392. {
  393. PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
  394. }
  395. if (PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"].ToString() == "3" && !CommonHelper.GetPagesInRange(ref PageIndexLists, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"].ToString(), CPDFDocument.InitWithFilePath(fileName).PageCount, new char[] { ',' }, new char[] { '-' }, true))
  396. {
  397. PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"] = "0";
  398. }
  399. pdfdatatable.Rows.Add(f.Name, PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeText"], PDFCurrentDataTable.Rows[datatableindex]["FilePageRangeSelectIndex"], isEvenPage(fileName), file_size, PDFCurrentDataTable.Rows[datatableindex]["FileState"]);
  400. datatableindex++;
  401. }
  402. PDFDataTable = pdfdatatable;
  403. HomePageBatchProcessingDialogModel.FilePaths = fileNames;
  404. }
  405. /// <summary>
  406. /// 更新Currentlistview显示
  407. /// pagerangetext 自定义页面范围字符串 pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面)isevenpageisenabled 偶数页状态 state 状态显示字符串
  408. /// </summary>
  409. public void updateCurrentListview(string pagerangetext = "1", string pagerangeselectindex = "0", bool isevenpageisenabled = true, string state = "待完成")
  410. {
  411. if (fileNames.Count >= FileNameNumber)
  412. {
  413. for (int i = 0; fileNames.Count - FileNameNumber > i; i++)
  414. {
  415. PDFCurrentDataTable.Rows.Add(pagerangetext, pagerangeselectindex, isevenpageisenabled, state);
  416. }
  417. }
  418. else
  419. {
  420. Reverseorder(ref fileNamesView);
  421. foreach (int filenamesview in fileNamesView)
  422. {
  423. PDFCurrentDataTable.Rows.RemoveAt(filenamesview);
  424. }
  425. }
  426. }
  427. /// <summary>
  428. /// 更新Currentlistview显示
  429. /// pagerangetext 自定义页面范围字符串 pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面)
  430. /// </summary>
  431. public void updateFilesPageRange(string pagerangetext = "1", string pagerangeselectindex = "0")
  432. {
  433. for (int i = 0; fileNames.Count > i; i++)
  434. {
  435. PDFDataTable.Rows[i]["FilePageRangeText"] = pagerangetext;
  436. PDFDataTable.Rows[i]["FilePageRangeSelectIndex"] = pagerangeselectindex;
  437. PDFCurrentDataTable.Rows[i]["FilePageRangeText"] = pagerangetext;
  438. PDFCurrentDataTable.Rows[i]["FilePageRangeSelectIndex"] = pagerangeselectindex;
  439. }
  440. }
  441. /// <summary>
  442. /// 获取文件列表单个文件对应的页码范围
  443. /// document 文档对象 pagerangetext 自定义页面范围字符串 pagerangeselectindex combobox下拉索引(0全部页面 1奇数页 2偶数页 3自定义页面)
  444. /// </summary>
  445. public string getFilePageRange(CPDFDocument document, string pagerangetext = "1", string pagerangeselectindex = "0")
  446. {
  447. string filePageRange = "1";
  448. EditToolsHelper.GetPageRange(int.Parse(pagerangeselectindex), document, ref filePageRange, pagerangetext);
  449. return filePageRange;
  450. }
  451. /// <summary>
  452. /// 判断是否关闭偶数页
  453. /// document 文档对象 )
  454. /// </summary>
  455. public bool isEvenPage(string filename)
  456. {
  457. CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
  458. bool isevenpage = false;
  459. if (document.PageCount > 1)
  460. {
  461. isevenpage = true;
  462. }
  463. document.Release();
  464. return isevenpage;
  465. }
  466. /// <summary>
  467. /// 逆序int类型集合
  468. /// </summary>
  469. public void Reverseorder(ref List<int> Numbers)
  470. {
  471. Numbers = Numbers.OrderBy(a => a).ToList();
  472. Numbers.Reverse();
  473. }
  474. /// <summary>
  475. /// 打开文件PDF
  476. /// </summary>
  477. public void openfiledialog()
  478. {
  479. foreach (int filenamesview in fileNamesView)
  480. {
  481. System.Diagnostics.Process.Start(fileNames[filenamesview]);
  482. }
  483. }
  484. /// <summary>
  485. /// 删除文件PDF
  486. /// </summary>
  487. public void removepdffile()
  488. {
  489. FileNameNumber = fileNames.Count;
  490. Reverseorder(ref fileNamesView);
  491. foreach (int filenamesview in fileNamesView)
  492. {
  493. //Trace.WriteLine(filenamesview);
  494. fileNames.Remove(fileNames[filenamesview]);
  495. }
  496. if (fileNames.Count < 1)
  497. {
  498. SetHeaderFooterGridIsEnabled = "False";
  499. AddFileVisibility = Visibility.Visible;
  500. }
  501. updateListview("待确定");
  502. }
  503. public void PDFFileCount()
  504. {
  505. if (fileNames.Count == 0)
  506. {
  507. SetHeaderFooterGridIsEnabled = "False";
  508. AddFileVisibility = Visibility.Visible;
  509. }
  510. else
  511. {
  512. SetHeaderFooterGridIsEnabled = "True";
  513. AddFileVisibility = Visibility.Collapsed;
  514. }
  515. }
  516. #endregion
  517. #region 构架行为
  518. public void OnNavigatedTo(NavigationContext navigationContext)
  519. {
  520. List<string> filepath = new List<string>();
  521. navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
  522. navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
  523. navigationContext.Parameters.TryGetValue<List<string>>(ParameterNames.FilePath, out filepath);
  524. if (filepath != null)
  525. {
  526. fileNames = filepath;
  527. PDFFileCount();
  528. CreateGridSpan = "1";
  529. CreateGridSpanVisibility = Visibility.Visible;
  530. updateListview("待确定");
  531. EnterSelectedContent(TemplateListName);
  532. }
  533. }
  534. public bool IsNavigationTarget(NavigationContext navigationContext)
  535. {
  536. return true;
  537. }
  538. public void OnNavigatedFrom(NavigationContext navigationContext)
  539. {
  540. }
  541. #endregion
  542. }
  543. }