CPDFTitleBarControl.xaml.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. namespace ComPDFKit.Controls.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 event EventHandler FlattenEvent;
  19. public event EventHandler PrintEvent;
  20. public CPDFTitleBarControl()
  21. {
  22. InitializeComponent();
  23. }
  24. private void OpenFileItem_Click(object sender, RoutedEventArgs e)
  25. {
  26. OpenFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  27. }
  28. private void SaveFileItem_Click(object sender, RoutedEventArgs e)
  29. {
  30. SaveFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  31. }
  32. private void SaveAsItem_Click(object sender, RoutedEventArgs e)
  33. {
  34. SaveAsFileEvent?.Invoke(sender, RoutedEventArgs.Empty);
  35. }
  36. private void AboutUsItem_Click(object sender, RoutedEventArgs e)
  37. {
  38. System.Diagnostics.Process.Start("https://www.compdf.com/company/about");
  39. }
  40. private void ContactUs_Click(object sender, RoutedEventArgs e)
  41. {
  42. System.Diagnostics.Process.Start("https://www.compdf.com/contact-sales");
  43. }
  44. private void TechnicalSupport_Click(object sender, RoutedEventArgs e)
  45. {
  46. System.Diagnostics.Process.Start("https://www.compdf.com/support");
  47. }
  48. private void PrivacyAgreement_Click(object sender, RoutedEventArgs e)
  49. {
  50. System.Diagnostics.Process.Start("https://www.compdf.com/privacy-policy");
  51. }
  52. private void ServiceTerms_Click(object sender, RoutedEventArgs e)
  53. {
  54. System.Diagnostics.Process.Start("https://www.compdf.com/terms-of-service");
  55. }
  56. private void DeviceSerial_Click(object sender, RoutedEventArgs e)
  57. {
  58. var parentWindow = Window.GetWindow(this);
  59. DeviceSerialControl deviceSerialControl = new DeviceSerialControl()
  60. {
  61. Owner = parentWindow
  62. };
  63. deviceSerialControl.ShowDialog();
  64. }
  65. private void FlattenItem_Click(object sender, RoutedEventArgs e)
  66. {
  67. FlattenEvent?.Invoke(sender, RoutedEventArgs.Empty);
  68. }
  69. private void PrintItem_Click(object sender, RoutedEventArgs e)
  70. {
  71. PrintEvent?.Invoke(sender, RoutedEventArgs.Empty);
  72. }
  73. }
  74. }