CPDFTitleBarControl.xaml.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. namespace Compdfkit_Tools.PDFControl
  5. {
  6. public partial class CPDFTitleBarControl : UserControl
  7. {
  8. public static readonly DependencyProperty CanSaveProperty =
  9. DependencyProperty.RegisterAttached("CanSave", typeof(bool), typeof(CPDFTitleBarControl), new PropertyMetadata(false));
  10. public bool CanSave
  11. {
  12. get { return (bool)GetValue(CanSaveProperty); }
  13. set { SetValue(CanSaveProperty, value); }
  14. }
  15. public event EventHandler OpenFileEvent;
  16. public event EventHandler SaveFileEvent;
  17. public event EventHandler SaveAsFileEvent;
  18. public CPDFTitleBarControl()
  19. {
  20. InitializeComponent();
  21. }
  22. private void OpenFileItem_Click(object sender, RoutedEventArgs e)
  23. {
  24. OpenFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  25. }
  26. private void SaveFileItem_Click(object sender, RoutedEventArgs e)
  27. {
  28. SaveFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  29. }
  30. private void SaveAsItem_Click(object sender, RoutedEventArgs e)
  31. {
  32. SaveAsFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  33. }
  34. private void AboutUsItem_Click(object sender, RoutedEventArgs e)
  35. {
  36. System.Diagnostics.Process.Start("https://www.compdf.com/company/about");
  37. }
  38. private void ContactUs_Click(object sender, RoutedEventArgs e)
  39. {
  40. System.Diagnostics.Process.Start("https://www.compdf.com/contact-sales");
  41. }
  42. private void PrivacyAgreement_Click(object sender, RoutedEventArgs e)
  43. {
  44. System.Diagnostics.Process.Start("https://www.compdf.com/privacy-policy");
  45. }
  46. private void ServiceTerms_Click(object sender, RoutedEventArgs e)
  47. {
  48. System.Diagnostics.Process.Start("https://www.compdf.com/terms-of-service");
  49. }
  50. private void DeviceSerial_Click(object sender, RoutedEventArgs e)
  51. {
  52. var parentWindow = Window.GetWindow(this);
  53. DeviceSerialControl deviceSerialControl = new DeviceSerialControl()
  54. {
  55. Owner = parentWindow
  56. };
  57. deviceSerialControl.ShowDialog();
  58. }
  59. }
  60. }