PageEditItem.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using Prism.Commands;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Media.Imaging;
  10. namespace PDF_Office.Model.PageEdit
  11. {
  12. public class PageEditItem:BindableBase
  13. {
  14. private int pageNumber;
  15. /// <summary>
  16. /// 页码
  17. /// </summary>
  18. public int PageNumber
  19. {
  20. get { return pageNumber; }
  21. set
  22. {
  23. SetProperty(ref pageNumber, value);
  24. }
  25. }
  26. private string pageSize = "";
  27. /// <summary>
  28. /// 用于显示的页面尺寸
  29. /// </summary>
  30. public string PageSize
  31. {
  32. get { return pageSize; }
  33. set
  34. {
  35. SetProperty(ref pageSize, value);
  36. }
  37. }
  38. /// <summary>
  39. /// Size类型的页面尺寸 用于插入功能
  40. /// </summary>
  41. private Size size;
  42. public Size Size
  43. {
  44. get { return size; }
  45. set { size = value;
  46. //if(Size.Width>0&&Size.Height>0)
  47. //{
  48. // var heigit = size.Height * 208 / size.Width;
  49. // ItemSize = new Size(208,heigit);
  50. //}
  51. }
  52. }
  53. private BitmapSource image;
  54. /// <summary>
  55. /// 页面缩略图
  56. /// </summary>
  57. public BitmapSource Image
  58. {
  59. get { return image; }
  60. set
  61. {
  62. SetProperty(ref image, value);
  63. }
  64. }
  65. private bool showPageSize = false;
  66. /// <summary>
  67. /// 是否显示页码尺寸
  68. /// </summary>
  69. public bool ShowPageSize
  70. {
  71. get { return showPageSize; }
  72. set
  73. {
  74. SetProperty(ref showPageSize, value);
  75. }
  76. }
  77. private bool haveBookMark = false;
  78. /// <summary>
  79. /// 该页是否有书签标记
  80. /// </summary>
  81. public bool HaveBookMark
  82. {
  83. get { return haveBookMark; }
  84. set
  85. {
  86. SetProperty(ref haveBookMark, value);
  87. }
  88. }
  89. private Visibility visible = Visibility.Visible;
  90. /// <summary>
  91. /// 是否显示
  92. /// </summary>
  93. public Visibility Visible
  94. {
  95. get { return visible; }
  96. set
  97. {
  98. SetProperty(ref visible, value);
  99. }
  100. }
  101. private bool selected = false;
  102. /// <summary>
  103. /// 是否选中
  104. /// 用于获取项的选中状态
  105. /// </summary>
  106. public bool Selected
  107. {
  108. get { return selected; }
  109. set
  110. {
  111. SetProperty(ref selected, value);
  112. }
  113. }
  114. private Size itemSize = new Size(208, 294);
  115. /// <summary>
  116. /// 控件大小
  117. /// 直接修改Listbox 容器的项大小,会导致间距有问题,所有采用动态绑定大小的方式来实现Item大小更新
  118. /// </summary>
  119. public Size ItemSize
  120. {
  121. get { return itemSize; }
  122. set
  123. {
  124. SetProperty(ref itemSize, value);
  125. }
  126. }
  127. /// <summary>
  128. /// 此次打开中是否已经获取图片,避免重复拿图
  129. /// </summary>
  130. public bool IsGetImage = false;
  131. /// <summary>
  132. /// 是否是竖直的图
  133. /// </summary>
  134. public bool isVertical = true;
  135. }
  136. }