Browse Source

视图-阅读模式

OYXH\oyxh 2 years ago
parent
commit
ec7f244cb8

+ 1 - 0
PDF Office/App.xaml.cs

@@ -119,6 +119,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<ViewModularContent>();
             containerRegistry.RegisterForNavigation<SplitScreenContent>();
             containerRegistry.RegisterForNavigation<ThemesContent>();
+            containerRegistry.RegisterForNavigation<ReadModeContent>();
 
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();

+ 8 - 0
PDF Office/Model/ParameterNames.cs

@@ -35,12 +35,20 @@ namespace PDF_Office.Model
 
         public static string InsertType_Custom = "Insert_Custom";
 
+        /// <summary>
+        /// 书签
+        /// </summary>
         public static string Bookmark = "Bookmark";
 
         public static string Title = "Title";
 
         public static string BookmarkInfo = "BookmarkInfo";
 
+        /// <summary>
+        /// 底部工具栏
+        /// </summary>
+        public static string BottomToolContentViewModel = "BottomToolContentViewModel";
+
         /// <summary>
         /// BOTA缩略图
         /// </summary>

+ 11 - 0
PDF Office/Model/RegionNames.cs

@@ -116,6 +116,17 @@ namespace PDF_Office.Model
             }
         }
 
+        /// <summary>
+        /// 视图模块-阅读模式
+        /// </summary>
+        public static string ReadModeRegionName
+        {
+            get
+            {
+                return GetRegionName("ReadModeRegionName");
+            }
+        }
+
         /// <summary>
         /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
         /// 如果字典里没有键值就新建一个GUID,并插入到

+ 8 - 0
PDF Office/PDF Office.csproj

@@ -311,6 +311,7 @@
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\TextAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\TextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PropertyPanelContentViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadModeContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\SplitScreenContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ThemesContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ViewModularContentViewModel.cs" />
@@ -484,6 +485,9 @@
     <Compile Include="Views\PropertyPanel\PropertyPanelContent.xaml.cs">
       <DependentUpon>PropertyPanelContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml.cs">
+      <DependentUpon>ReadModeContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml.cs">
       <DependentUpon>SplitScreenContent.xaml</DependentUpon>
     </Compile>
@@ -844,6 +848,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

File diff suppressed because it is too large
+ 120 - 0
PDF Office/Styles/ButtonStyle.xaml


+ 1 - 1
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -201,7 +201,7 @@ namespace PDF_Office.ViewModels
 
                 NavigationParameters param = new NavigationParameters();
                 param.Add(ParameterNames.PDFViewer, PDFViewer);
-                param.Add("BottomToolContentViewModel", this);
+                param.Add(ParameterNames.BottomToolContentViewModel, this);
                 region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
             }
             else

+ 26 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/ReadModeContentViewModel.cs

@@ -0,0 +1,26 @@
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
+{
+    public class ReadModeContentViewModel : BindableBase, INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 0 - 8
PDF Office/ViewModels/PropertyPanel/ViewModular/ThemesContentViewModel.cs

@@ -26,14 +26,6 @@ using RadioButton = System.Windows.Controls.RadioButton;
 
 namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
 {
-    public enum ThemesDrawMode
-    {
-        Light,
-        Sepia,
-        Dark,
-        Reseda
-    }
-
     public class ThemesContentViewModel : BindableBase, INavigationAware
     {
         public CPDFViewer PDFViewer { get; set; }

+ 8 - 3
PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs

@@ -30,6 +30,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
 
         public CPDFViewer PDFViewer { get; set; }
         public BottomToolContentViewModel BottomToolContentViewModel { get; set; }
+        public ViewContentViewModel ViewContentViewModel { get; set; }
         public string SplitScreenViewRegionName { get; set; }
         public string ThemesContentName { get; set; }
         private Visibility splitScreenViewVisible = Visibility.Collapsed;
@@ -294,14 +295,18 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
-            var btnTool = navigationContext.Parameters["BottomToolContentViewModel"] as BottomToolContentViewModel;
+            CPDFViewer pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            BottomToolContentViewModel btnTool = navigationContext.Parameters["BottomToolContentViewModel"] as BottomToolContentViewModel;
             if (pdfview != null && btnTool != null)
             {
                 BottomToolContentViewModel = btnTool;
                 PDFViewer = pdfview;
             }
-
+            else
+            {
+                return;
+            }
+            
             IsSingleView = BottomToolContentViewModel.IsSingleView;
             IsTwoPageView = BottomToolContentViewModel.IsDoubleView;
             IsBookModeView = BottomToolContentViewModel.IsBookMode;

+ 55 - 17
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -19,13 +19,14 @@ using System.IO;
 using PDFSettings;
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.ViewModels.Tools;
+using PDF_Office.Views;
 
 namespace PDF_Office.ViewModels
 {
-
     public class ViewContentViewModel : BindableBase, INavigationAware
     {
         #region 属性、变量
+
         private CPDFViewer PDFViewer { get; set; }
 
         private MainContentViewModel mainViewModel { get; set; }
@@ -44,6 +45,8 @@ namespace PDF_Office.ViewModels
 
         public string ToolsBarContentRegionName { get; set; }
 
+        public string ReadModeRegionName { get; set; }
+
         /// <summary>
         /// 底部工具栏 RegionName
         /// </summary>
@@ -58,8 +61,8 @@ namespace PDF_Office.ViewModels
 
         public Action PageEditRedo { get; set; }
 
-
         private int gridToolRow = 1;
+
         /// <summary>
         /// 控制ToolContent的Row
         /// </summary>
@@ -73,6 +76,7 @@ namespace PDF_Office.ViewModels
         }
 
         private int gridToolRowSpan = 3;
+
         /// <summary>
         /// 控制ToolContent的RowSpan
         /// </summary>
@@ -86,6 +90,7 @@ namespace PDF_Office.ViewModels
         }
 
         private Visibility toolContentVisible = Visibility.Collapsed;
+
         /// <summary>
         /// 控制Content的显示 用于显示水印、贝茨码、密文等功能模块
         /// 留意:显示前需要先注入内容、设置好行和跨行数
@@ -100,6 +105,7 @@ namespace PDF_Office.ViewModels
         }
 
         private Visibility isLoading = Visibility.Collapsed;
+
         /// <summary>
         /// 是否正在加载中
         /// </summary>
@@ -113,6 +119,7 @@ namespace PDF_Office.ViewModels
         }
 
         private Visibility toolsbarContentVisible = Visibility.Collapsed;
+
         /// <summary>
         /// 控制ToolsBarContent的显示
         /// 留意:显示前需要先注入内容、设置好行和跨行数
@@ -127,6 +134,7 @@ namespace PDF_Office.ViewModels
         }
 
         private bool isPorpertyOpen = false;
+
         /// <summary>
         /// 属性栏是否展开
         /// </summary>
@@ -139,8 +147,22 @@ namespace PDF_Office.ViewModels
             }
         }
 
+        private Visibility isReadMode = Visibility.Visible;
+
+        /// <summary>
+        ///是否为阅读模式
+        /// </summary>
+        public Visibility IsReadMode
+        {
+            get { return isReadMode; }
+            set
+            {
+                SetProperty(ref isReadMode, value);
+            }
+        }
 
         private bool canSave;
+
         /// <summary>
         /// 是否可以保存
         /// </summary>
@@ -154,6 +176,7 @@ namespace PDF_Office.ViewModels
         }
 
         private bool canUndo;
+
         /// <summary>
         /// 是否可以进行Undo
         /// </summary>
@@ -167,6 +190,7 @@ namespace PDF_Office.ViewModels
         }
 
         private bool canRedo;
+
         /// <summary>
         /// 是否可以进行Redo
         /// </summary>
@@ -180,6 +204,7 @@ namespace PDF_Office.ViewModels
         }
 
         private GridLength botaWidth = new GridLength(48);
+
         /// <summary>
         /// BOTA栏的宽度
         /// </summary>
@@ -197,6 +222,7 @@ namespace PDF_Office.ViewModels
         }
 
         private int selectedIndex;
+
         /// <summary>
         /// 工具栏选中项的索引
         /// </summary>
@@ -209,8 +235,8 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
         private bool openBOTA = false;
+
         /// <summary>
         /// 是否展开BOTA
         /// </summary>
@@ -227,7 +253,6 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
         private Dictionary<string, string> regionNameByTabItem;
 
         private Dictionary<string, string> barContentByTabItem;
@@ -245,9 +270,11 @@ namespace PDF_Office.ViewModels
         /// 鼠标滚轮缩放的缩放值
         /// </summary>
         private double[] zoomLevel = { 1.00f, 10, 25, 50, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
-        #endregion
+
+        #endregion 属性、变量
 
         #region 命令
+
         public DelegateCommand LoadFile { get; set; }
 
         public DelegateCommand Load { get; set; }
@@ -261,7 +288,10 @@ namespace PDF_Office.ViewModels
         public DelegateCommand UndoCommand { get; set; }
 
         public DelegateCommand RedoCommand { get; set; }
-        #endregion
+
+        public DelegateCommand<object> MenuEnterReadMode { get; set; }
+
+        #endregion 命令
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
@@ -280,6 +310,8 @@ namespace PDF_Office.ViewModels
             BOTARegionName = RegionNames.BOTARegionName;
             PropertyRegionName = RegionNames.PropertyRegionName;
             BottomToolRegionName = RegionNames.BottomToolRegionName;
+            ReadModeRegionName = RegionNames.ReadModeRegionName;
+            MenuEnterReadMode = new DelegateCommand<object>(MenuEnterReadModeEvent);
 
             //未显示时无法注册上Region名称
             ToolContentVisible = Visibility.Visible;
@@ -294,6 +326,10 @@ namespace PDF_Office.ViewModels
             InitialbarContentByTabItem(ref barContentByTabItem);
         }
 
+        private void MenuEnterReadModeEvent(object obj)
+        {
+        }
+
         private void InitialregionNameByTabItem(ref Dictionary<string, string> dictionary)
         {
             dictionary.Add("TabItemPageEdit", ToolContentRegionName);
@@ -364,6 +400,7 @@ namespace PDF_Office.ViewModels
         }
 
         #region PDFViewer鼠标滚轮缩放事件
+
         public void PdfViewer_MouseWheelZoomHandler(object sender, bool e)
         {
             double newZoom = CheckZoomLevel(PDFViewer.ZoomFactor + (e ? 0.01 : -0.01), e);
@@ -398,9 +435,11 @@ namespace PDF_Office.ViewModels
             }
             return standardZoom / 100;
         }
-        #endregion
+
+        #endregion PDFViewer鼠标滚轮缩放事件
 
         #region Navigate
+
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             if (isOpenFile)
@@ -418,7 +457,6 @@ namespace PDF_Office.ViewModels
                 loadFile();
             }
 
-
             isOpenFile = true;
         }
 
@@ -429,11 +467,12 @@ namespace PDF_Office.ViewModels
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
-
         }
-        #endregion
+
+        #endregion Navigate
 
         #region 方法
+
         private void Undo()
         {
             if (isInPageEdit)
@@ -468,8 +507,10 @@ namespace PDF_Office.ViewModels
                 NavigationParameters parameters = new NavigationParameters();
                 parameters.Add(ParameterNames.PDFViewer, PDFViewer);
                 parameters.Add(ParameterNames.ViewContentViewModel, this);
+
                 region.RequestNavigate(BOTARegionName, "BOTAContent", parameters);
                 region.RequestNavigate(BottomToolRegionName, "BottomToolContent", parameters);
+                region.RequestNavigate(ReadModeRegionName, "ReadModeContent", parameters);
 
                 //TODO 根据上一次关闭记录的菜单,选中TabItem
                 EnterSelectedBar("TabItemAnnotation");
@@ -487,7 +528,6 @@ namespace PDF_Office.ViewModels
                 region.RequestNavigate(PropertyRegionName, Content, parameters);
             }
          ));
-
         }
 
         /// <summary>
@@ -736,7 +776,7 @@ namespace PDF_Office.ViewModels
 
         /// <summary>
         /// 进入工具编辑(如页面编辑、水印、密文等)模式
-        /// </summary> 
+        /// </summary>
         /// <param name="targetToolMode">要导航过去的控件名称</param>
         /// <param name="valuePairs">导航需要传送的参数,为空时,默认传送PDFView和ViewContentViewModel</param>
         private async void EnterToolMode(string targetToolMode, NavigationParameters valuePairs = null)
@@ -780,9 +820,7 @@ namespace PDF_Office.ViewModels
                 isInPageEdit = false;
             }
         }
-        #endregion
-    }
-}
-
-
 
+        #endregion 方法
+    }
+}

+ 107 - 0
PDF Office/Views/PropertyPanel/ViewModular/ReadModeContent.xaml

@@ -0,0 +1,107 @@
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.ViewModular.ReadModeContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:ViewModular="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
+    xmlns:converter="clr-namespace:PDF_Office.DataConvert"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.ViewModular"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="auto"
+    d:DataContext="{d:DesignInstance Type=ViewModular:ReadModeContentViewModel}"
+    d:DesignHeight="44"
+    d:DesignWidth="220"
+    Background="#CC000000"
+    mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <StackPanel Name="ParentPanel" Orientation="Horizontal">
+
+        <RepeatButton
+            x:Name="btnZoomOut"
+            Width="32"
+            Height="32"
+            Margin="1,0,2,0"
+            Background="Transparent"
+            BorderThickness="0"
+            Interval="200"
+            Template="{StaticResource zoomout}" />
+        <RepeatButton
+            Name="btnZoomIn"
+            Width="32"
+            Height="32"
+            Margin="0,0,1,0"
+            Background="Transparent"
+            BorderThickness="0"
+            Interval="200"
+            Template="{StaticResource zoomin}" />
+
+        <Border
+            Width="92"
+            Height="32"
+            BorderBrush="White"
+            BorderThickness="0">
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition />
+                    <ColumnDefinition />
+                </Grid.ColumnDefinitions>
+                <Grid>
+                    <TextBox
+                        x:Name="txtCurrentPageNum"
+                        Width="45"
+                        Height="32"
+                        Padding="5,5.5,0,0"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        CaretBrush="White"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        Foreground="White"
+                        Text="1"
+                        TextAlignment="Center" />
+                    <TextBlock
+                        Name="TxbTitle"
+                        Width="45"
+                        Height="32"
+                        Padding="5,5.5,0,0"
+                        Background="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Grid}}, Path=Background}"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        Foreground="White"
+                        Text="1"
+                        TextAlignment="Center"
+                        Visibility="Visible" />
+                </Grid>
+
+                <TextBlock
+                    x:Name="txtPageCount"
+                    Grid.Column="1"
+                    Width="45"
+                    Height="32"
+                    Padding="0,5.5,0,0"
+                    FontFamily="Segoe UI"
+                    FontSize="14"
+                    Foreground="#999999"
+                    Text="/5"
+                    TextAlignment="Left" />
+            </Grid>
+        </Border>
+        <Button
+            Name="btnPrePage"
+            Margin="1,0,2,0"
+            Background="Transparent"
+            Template="{StaticResource prepage}" />
+        <Button
+            x:Name="btnNextPage"
+            Margin="2,0,1,0"
+            Background="Transparent"
+            Template="{StaticResource nextpage}" />
+    </StackPanel>
+</UserControl>

+ 28 - 0
PDF Office/Views/PropertyPanel/ViewModular/ReadModeContent.xaml.cs

@@ -0,0 +1,28 @@
+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>
+    /// ReadModeContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class ReadModeContent : UserControl
+    {
+        public ReadModeContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 1 - 1
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml

@@ -116,7 +116,7 @@
                 Name="RbtnReadMode"
                 HorizontalAlignment="Left"
                 Click="RbtnReadMode_Click"
-                GroupName="DisplayMode"
+
                 Style="{StaticResource PageViewRadioBtn}">
                 <StackPanel Margin="0,0,3,0">
                     <Grid

+ 14 - 8
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs

@@ -1,4 +1,6 @@
-using System;
+using ComPDFKitViewer;
+using PDF_Office.ViewModels;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -25,20 +27,24 @@ namespace PDF_Office.Views.PropertyPanel.ViewModular
             InitializeComponent();
         }
 
+        /// <summary>
+        /// 阅读模式
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void RbtnReadMode_Click(object sender, RoutedEventArgs e)
         {
             RbtnReadMode.IsChecked = false;
-            var window = Window.GetWindow(this) as MainWindow;
-            if (window != null)
+            if (Window.GetWindow(this) is MainWindow window)
             {
-                var main = window.TabablzControl.SelectedItem as MainContent;
-                if (main != null)
+                if (window.TabablzControl.SelectedItem is MainContent main)
                 {
-                    var mainContent = main.ContentMain.Content as ViewContent;
-                    if (mainContent != null)
+                    if (main.ContentMain.Content is ViewContent viewContent)
                     {
+                        viewContent.MenuEnterReadMode_Click(sender, e);
+
                     }
-                    //main.GetCurrentViewer()?.MenuEnterReadMode_Click(null, null);
+                    
                 }
             }
         }

+ 32 - 6
PDF Office/Views/ViewContent.xaml

@@ -14,6 +14,7 @@
     d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
+    KeyDown="UserControl_KeyDown"
     mc:Ignorable="d">
     <i:Interaction.Triggers>
         <i:EventTrigger EventName="Loaded">
@@ -22,6 +23,10 @@
     </i:Interaction.Triggers>
     <UserControl.Resources>
         <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+
             <Style x:Key="MenuButtonStyle" TargetType="{x:Type Button}">
                 <Setter Property="Width" Value="20" />
                 <Setter Property="Height" Value="20" />
@@ -36,7 +41,10 @@
             <RowDefinition Height="32" />
         </Grid.RowDefinitions>
         <!--  左边菜单按钮  -->
-        <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
+        <StackPanel
+            HorizontalAlignment="Left"
+            Orientation="Horizontal"
+            Visibility="{Binding IsReadMode}">
             <Button
                 Margin="8"
                 Style="{StaticResource MenuButtonStyle}"
@@ -69,7 +77,10 @@
             </Button>
         </StackPanel>
         <!--  右边菜单按钮  -->
-        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+        <StackPanel
+            HorizontalAlignment="Right"
+            Orientation="Horizontal"
+            Visibility="{Binding IsReadMode}">
             <Button
                 Margin="8"
                 Style="{StaticResource MenuButtonStyle}"
@@ -98,7 +109,8 @@
             VerticalAlignment="Top"
             BorderThickness="0"
             SelectedIndex="{Binding TabSelectedIndex, Mode=TwoWay}"
-            Style="{StaticResource TabControlWithUnderLineStyle}">
+            Style="{StaticResource TabControlWithUnderLineStyle}"
+            Visibility="{Binding IsReadMode}">
             <cus:IconAndTextTabItem
                 x:Name="TabItemAnnotation"
                 Header="注释"
@@ -187,7 +199,7 @@
                 </ColumnDefinition>
             </Grid.ColumnDefinitions>
 
-            <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" />
+            <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" Visibility="{Binding IsReadMode}" />
             <GridSplitter
                 Grid.Column="1"
                 Width="12"
@@ -200,11 +212,25 @@
                 HorizontalAlignment="Stretch"
                 prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
             <ScrollViewer Grid.Column="4" VerticalScrollBarVisibility="Auto">
-                <ContentControl prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
+                <ContentControl prism:RegionManager.RegionName="{Binding PropertyRegionName}" Visibility="{Binding IsReadMode}" />
             </ScrollViewer>
+            <!--  阅读模式下的页面控件  -->
+            <ContentControl
+                x:Name="ReadModeContent"
+                Grid.Column="0"
+                Grid.ColumnSpan="5"
+                Height="44"
+                Margin="0,0,0,5"
+                HorizontalAlignment="Center"
+                VerticalAlignment="Bottom"
+                prism:RegionManager.RegionName="{Binding ReadModeRegionName}"
+                Visibility="Collapsed" />
         </Grid>
 
-        <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
+        <ContentControl
+            Grid.Row="3"
+            prism:RegionManager.RegionName="{Binding BottomToolRegionName}"
+            Visibility="{Binding IsReadMode}" />
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->
         <ContentControl

+ 53 - 2
PDF Office/Views/ViewContent.xaml.cs

@@ -1,4 +1,10 @@
-using System.Windows.Controls;
+using ComPDFKitViewer;
+using PDF_Office.ViewModels;
+using PDF_Office.Views.PropertyPanel.ViewModular;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
 
 namespace PDF_Office.Views
 {
@@ -7,14 +13,59 @@ namespace PDF_Office.Views
     /// </summary>
     public partial class ViewContent : UserControl
     {
+        private ViewContentViewModel viewModel = null;
+
         public ViewContent()
         {
             InitializeComponent();
+            viewModel = (ViewContentViewModel)this.DataContext;
+        }
+
+        public void MenuEnterReadMode_Click(object sender, RoutedEventArgs e)
+        {
+            if (viewModel != null)
+            {
+                App.IsBookMode = true;
+                SetReadMode(Visibility.Collapsed, false, 0, 4, 0, 4);
+            }
+        }
+
+        private void SetReadMode(Visibility visibility, bool isPropertyOpen, int viewColumn, int viewColumnSpan, int docViewColumn, int docViewColumnSpan)
+        {
+            viewModel.IsReadMode = visibility;
+            viewModel.IsPropertyOpen = isPropertyOpen;
+            viewModel.ToolContentVisible = visibility;
+            viewModel.ToolsBarContentVisible = visibility;
+            if (visibility != Visibility.Visible)
+            {
+                this.ReadModeContent.Visibility = Visibility.Visible;
+                
+            }
+            else
+            {
+                this.ReadModeContent.Visibility = Visibility.Collapsed;
+            }
+
+            Grid.SetColumn(this.PDFViewerContent, viewColumn);
+            Grid.SetColumnSpan(this.PDFViewerContent, viewColumnSpan);
+            Grid.SetRow(this.DocumentView, docViewColumn);
+            Grid.SetRowSpan(this.DocumentView, docViewColumnSpan);
         }
 
         private void PropPanel_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
         {
+        }
 
+        private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
+        {
+            if (Key.Escape == e.Key)
+            {
+                if (viewModel != null)
+                {
+                    App.IsBookMode = false;
+                    SetReadMode(Visibility.Visible, true, 2, 1, 2, 1);
+                }
+            }
         }
     }
-}
+}