123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using ComPDFKitViewer;
- using PDF_Office.ViewModels;
- using PDF_Office.ViewModels.PropertyPanel.ViewModular;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace PDF_Office.Views.PropertyPanel.ViewModular
- {
- /// <summary>
- /// ViewModularContent.xaml 的交互逻辑
- /// </summary>
- public partial class ViewModularContent : UserControl
- {
- private ViewModularContentViewModel viewModel = null;
- public ViewModularContent()
- {
- InitializeComponent();
- viewModel = this.DataContext as ViewModularContentViewModel;
- }
- /// <summary>
- /// 阅读模式
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void RbtnReadMode_Click(object sender, RoutedEventArgs e)
- {
- RbtnReadMode.IsChecked = false;
- if (Window.GetWindow(this) is MainWindow window)
- {
- if (window.TabablzControl.SelectedItem is MainContent main)
- {
- if (main.ContentMain.Content is ViewContent viewContent)
- {
- //viewContent.RbtnReadMode(sender, e);
- ViewContentViewModel model = viewContent.DataContext as ViewContentViewModel;
- model.RbtnReadMode();
- }
- }
- }
- }
- private void btnRotateRight_Click(object sender, RoutedEventArgs e)
- {
- if (Window.GetWindow(this) is MainWindow window)
- {
- if (window.TabablzControl.SelectedItem is MainContent main)
- {
- if (main.ContentMain.Content is ViewContent viewContent)
- {
- foreach (var item in viewContent.GridViewer.Children)
- {
- if (item is ContentControl control)
- {
- if (control.Content is SplitScreenContent splitScreenContent)
- {
- if (splitScreenContent.PDFViewerContent.Content != null)
- {
- viewModel.SplitScreenPDFViewer = (ComPDFKitViewer.PdfViewer.CPDFViewer)splitScreenContent.PDFViewerContent.Content;
- break;
- }
- }
- }
- }
- }
- }
- }
- viewModel.RotateCommand.Execute((sender as Button).Tag.ToString());
- }
- }
- }
|