ViewModularContent.xaml.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using ComPDFKitViewer;
  2. using PDF_Master.ViewModels;
  3. using PDF_Master.ViewModels.PropertyPanel.ViewModular;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Data;
  12. using System.Windows.Documents;
  13. using System.Windows.Input;
  14. using System.Windows.Media;
  15. using System.Windows.Media.Imaging;
  16. using System.Windows.Navigation;
  17. using System.Windows.Shapes;
  18. namespace PDF_Master.Views.PropertyPanel.ViewModular
  19. {
  20. /// <summary>
  21. /// ViewModularContent.xaml 的交互逻辑
  22. /// </summary>
  23. public partial class ViewModularContent : UserControl
  24. {
  25. private ViewModularContentViewModel viewModel = null;
  26. public ViewModularContent()
  27. {
  28. InitializeComponent();
  29. viewModel = this.DataContext as ViewModularContentViewModel;
  30. }
  31. /// <summary>
  32. /// 阅读模式
  33. /// </summary>
  34. /// <param name="sender"></param>
  35. /// <param name="e"></param>
  36. private void RbtnReadMode_Click(object sender, RoutedEventArgs e)
  37. {
  38. RbtnReadMode.IsChecked = false;
  39. if (Window.GetWindow(this) is MainWindow window)
  40. {
  41. if (window.TabablzControl.SelectedItem is MainContent main)
  42. {
  43. if (main.ContentMain.Content is ViewContent viewContent)
  44. {
  45. //viewContent.RbtnReadMode(sender, e);
  46. ViewContentViewModel model = viewContent.DataContext as ViewContentViewModel;
  47. model.On_ReadMode();
  48. }
  49. }
  50. }
  51. }
  52. private void btnRotateRight_Click(object sender, RoutedEventArgs e)
  53. {
  54. //分屏视图,同步旋转
  55. //if (Window.GetWindow(this) is MainWindow window)
  56. //{
  57. // if (window.TabablzControl.SelectedItem is MainContent main)
  58. // {
  59. // if (main.ContentMain.Content is ViewContent viewContent)
  60. // {
  61. // foreach (var item in viewContent.GridViewer.Children)
  62. // {
  63. // if (item is ContentControl control)
  64. // {
  65. // if (control.Content is SplitScreenContent splitScreenContent)
  66. // {
  67. // if (splitScreenContent.PDFViewerContent.Content != null)
  68. // {
  69. // viewModel.SplitScreenPDFViewer = (ComPDFKitViewer.PdfViewer.CPDFViewer)splitScreenContent.PDFViewerContent.Content;
  70. // break;
  71. // }
  72. // }
  73. // }
  74. // }
  75. // }
  76. // }
  77. //}
  78. viewModel.RotateCommand.Execute((sender as Button).Tag.ToString());
  79. }
  80. }
  81. }