using ComPDFKitViewer;
using ComPDFKitViewer.PdfViewer;
using PDF_Office.Model;
using PDF_Office.ViewModels;
using PDF_Office.Views.PropertyPanel.ViewModular;
using Prism.Regions;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;

namespace PDF_Office.Views
{
    /// <summary>
    /// Interaction logic for ViewContent
    /// </summary>
    public partial class ViewContent : UserControl
    {
        private ViewContentViewModel viewModel = null;

        public ViewContent()
        {
            InitializeComponent();
            viewModel = (ViewContentViewModel)this.DataContext;
        }

        /// <summary>
        /// 退出阅读模式
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (Key.Escape == e.Key)
            {
                if (viewModel != null)
                {
                    //App.IsBookMode = false;
                    //SetReadMode(false);
                    viewModel.UnReadModel();
                }
            }
        }
    }
}