using ComPDFKitViewer;
using PDF_Master.ViewModels;
using PDF_Master.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_Master.Views.PropertyPanel.ViewModular
{
///
/// ViewModularContent.xaml 的交互逻辑
///
public partial class ViewModularContent : UserControl
{
private ViewModularContentViewModel viewModel = null;
public ViewModularContent()
{
InitializeComponent();
viewModel = this.DataContext as ViewModularContentViewModel;
}
///
/// 阅读模式
///
///
///
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.On_ReadMode();
}
}
}
}
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());
}
}
}