ViewContent.xaml.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.PdfViewer;
  3. using PDF_Office.Model;
  4. using PDF_Office.ViewModels;
  5. using PDF_Office.Views.PropertyPanel.ViewModular;
  6. using Prism.Regions;
  7. using System;
  8. using System.Threading;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. using System.Windows.Controls;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Threading;
  15. namespace PDF_Office.Views
  16. {
  17. /// <summary>
  18. /// Interaction logic for ViewContent
  19. /// </summary>
  20. public partial class ViewContent : UserControl
  21. {
  22. private ViewContentViewModel viewModel = null;
  23. public ViewContent()
  24. {
  25. InitializeComponent();
  26. viewModel = (ViewContentViewModel)this.DataContext;
  27. }
  28. /// <summary>
  29. /// 退出阅读模式
  30. /// </summary>
  31. /// <param name="sender"></param>
  32. /// <param name="e"></param>
  33. private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
  34. {
  35. if (Key.Escape == e.Key)
  36. {
  37. if (viewModel != null)
  38. {
  39. //App.IsBookMode = false;
  40. //SetReadMode(false);
  41. viewModel.UnReadModel();
  42. }
  43. }
  44. }
  45. }
  46. }