CPDFTitleBarControl.xaml.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Compdfkit_Tools.Helper;
  2. using ComPDFKitViewer.PdfViewer;
  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.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace Compdfkit_Tools.PDFControl
  18. {
  19. public partial class CPDFTitleBarControl : UserControl
  20. {
  21. public static readonly DependencyProperty CanSaveProperty =
  22. DependencyProperty.RegisterAttached("CanSave", typeof(bool), typeof(CPDFTitleBarControl), new PropertyMetadata(false));
  23. public bool CanSave
  24. {
  25. get { return (bool)GetValue(CanSaveProperty); }
  26. set { SetValue(CanSaveProperty, value); }
  27. }
  28. public event EventHandler OpenFileEvent;
  29. public event EventHandler SaveFileEvent;
  30. public event EventHandler SaveAsFileEvent;
  31. public CPDFTitleBarControl()
  32. {
  33. InitializeComponent();
  34. }
  35. private void OpenFileItem_Click(object sender, RoutedEventArgs e)
  36. {
  37. OpenFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  38. }
  39. private void SaveFileItem_Click(object sender, RoutedEventArgs e)
  40. {
  41. SaveFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  42. }
  43. private void SaveAsItem_Click(object sender, RoutedEventArgs e)
  44. {
  45. SaveAsFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  46. }
  47. private void AboutUsItem_Click(object sender, RoutedEventArgs e)
  48. {
  49. System.Diagnostics.Process.Start("https://www.compdf.com/company/about");
  50. }
  51. private void ContactUs_Click(object sender, RoutedEventArgs e)
  52. {
  53. System.Diagnostics.Process.Start("https://www.compdf.com/contact-sales");
  54. }
  55. private void PrivacyAgreement_Click(object sender, RoutedEventArgs e)
  56. {
  57. System.Diagnostics.Process.Start("https://www.compdf.com/privacy-policy");
  58. }
  59. private void ServiceTerms_Click(object sender, RoutedEventArgs e)
  60. {
  61. System.Diagnostics.Process.Start("https://www.compdf.com/terms-of-service");
  62. }
  63. }
  64. }