LinkAnnotProperty.xaml.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using ComPDFKitViewer.AnnotEvent;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace PDF_Office.Views.PropertyPanel.AnnotPanel
  17. {
  18. /// <summary>
  19. /// LinkAnnotProperty.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class LinkAnnotProperty : UserControl
  22. {
  23. public int TotalPage { get; set; }
  24. public LinkAnnotProperty()
  25. {
  26. InitializeComponent();
  27. }
  28. internal void SetTextBoxEnableOrNot(bool enable, int totalPage)
  29. {
  30. TotalPage = totalPage;
  31. PageNumText.Text = string.Empty;
  32. PageWebText.Text = string.Empty;
  33. PageMailText.Text = string.Empty;
  34. PageNumText.IsEnabled = enable;
  35. if (PageNumText.IsEnabled == true)
  36. {
  37. //defaultPageNumText.Text = string.Format($"1-{totalPage}页");
  38. //PageNumText.PlaceholderText = string.Format($"1-{totalPage}页");
  39. PageNumText.PlaceHoldText = string.Format($"1-{totalPage}页");
  40. }
  41. else
  42. {
  43. //defaultPageNumText.Text = "Enter target page";
  44. //PageNumText.PlaceholderText = "Enter target page";
  45. PageNumText.PlaceHoldText = "Enter target page";
  46. }
  47. PageNumText.IsError = false;
  48. //BorderPageNumText.Background = enable ? Brushes.White : Brushes.LightGray;
  49. PageWebText.IsEnabled = enable;
  50. BorderPageWebText.Background = enable ? Brushes.White : Brushes.LightGray;
  51. PageMailText.IsEnabled = enable;
  52. BorderPageMailText.Background = enable ? Brushes.White : Brushes.LightGray;
  53. BtnGOorBack.IsEnabled = false;
  54. BtnLocation.IsEnabled = enable;
  55. }
  56. }
  57. }