Quellcode durchsuchen

Merge branch 'practice2' into dev

ZhouJieSheng vor 2 Jahren
Ursprung
Commit
34b6ceba19
33 geänderte Dateien mit 3487 neuen und 493 gelöschten Zeilen
  1. 24 13
      PDF Office/App.xaml.cs
  2. 30 22
      PDF Office/CustomControl/ColorDropBox.xaml
  3. 10 0
      PDF Office/Model/ParameterNames.cs
  4. 34 3
      PDF Office/Model/RegionNames.cs
  5. 52 0
      PDF Office/PDF Office.csproj
  6. 187 0
      PDF Office/Styles/ButtonStyle.xaml
  7. 108 0
      PDF Office/Styles/CheckBoxStyle.xaml
  8. 8 8
      PDF Office/Styles/ListViewStyle.xaml
  9. 188 0
      PDF Office/Styles/RadioButtonStyle.xaml
  10. 16 1
      PDF Office/Styles/TextBoxStyle.xaml
  11. 118 198
      PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs
  12. 70 36
      PDF Office/ViewModels/BottomToolContentViewModel.cs
  13. 63 3
      PDF Office/ViewModels/Dialog/BOTA/BookmarkInfoDialogViewModel.cs
  14. 210 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/ReadModeContentViewModel.cs
  15. 26 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/SplitScreenContentViewModel.cs
  16. 257 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/ThemesContentViewModel.cs
  17. 370 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs
  18. 71 32
      PDF Office/ViewModels/ViewContentViewModel.cs
  19. 25 84
      PDF Office/Views/BOTA/BookmarkContent.xaml
  20. 116 63
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  21. 8 4
      PDF Office/Views/BottomToolContent.xaml
  22. 1 1
      PDF Office/Views/Dialog/BOTA/AddBookmarkDialog.xaml
  23. 55 12
      PDF Office/Views/Dialog/BOTA/BookmarkInfoDialog.xaml
  24. 138 0
      PDF Office/Views/PropertyPanel/ViewModular/ReadModeContent.xaml
  25. 63 0
      PDF Office/Views/PropertyPanel/ViewModular/ReadModeContent.xaml.cs
  26. 21 0
      PDF Office/Views/PropertyPanel/ViewModular/SplitScreenContent.xaml
  27. 28 0
      PDF Office/Views/PropertyPanel/ViewModular/SplitScreenContent.xaml.cs
  28. 381 0
      PDF Office/Views/PropertyPanel/ViewModular/ThemesContent.xaml
  29. 264 0
      PDF Office/Views/PropertyPanel/ViewModular/ThemesContent.xaml.cs
  30. 343 0
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml
  31. 52 0
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs
  32. 51 10
      PDF Office/Views/ViewContent.xaml
  33. 99 3
      PDF Office/Views/ViewContent.xaml.cs

+ 24 - 13
PDF Office/App.xaml.cs

@@ -35,6 +35,7 @@ using PDF_Office.Views.Dialog.BOTA;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDF_Office.Views.FillAndSign;
 using PDF_Office.Views.FillAndSign.PropertyPanel;
+using PDF_Office.Views.PropertyPanel.ViewModular;
 
 namespace PDF_Office
 {
@@ -50,15 +51,16 @@ namespace PDF_Office
         public static List<string> OpenedFileList = new List<string>();
 
         public static bool IsFirstOpen = true;
+        public static bool IsBookMode = false;
 
         public App()
         {
 #if !DEBUG
-            //接入Appcenter后台数据检测
-            string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
-            AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
-            var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
-            AppCenter.SetCountryCode(countryCode);
+        //接入Appcenter后台数据检测
+        string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
+        AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
+        var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
+        AppCenter.SetCountryCode(countryCode);
 #endif
             LicenseVerify();
 
@@ -100,6 +102,7 @@ namespace PDF_Office
         protected override void RegisterTypes(IContainerRegistry containerRegistry)
         {
             #region 注册内容组件
+
             containerRegistry.RegisterForNavigation<HomeContent>();
             containerRegistry.RegisterForNavigation<ViewContent>();
             containerRegistry.RegisterForNavigation<MainContent>();
@@ -113,13 +116,18 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<ToolsBarContent>();
             containerRegistry.RegisterForNavigation<AnnotToolContent>();
             containerRegistry.RegisterForNavigation<BookmarkContent>();
+            containerRegistry.RegisterForNavigation<ViewModularContent>();
+            containerRegistry.RegisterForNavigation<SplitScreenContent>();
+            containerRegistry.RegisterForNavigation<ThemesContent>();
+            containerRegistry.RegisterForNavigation<ReadModeContent>();
+
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModMutipleContent>();
-            containerRegistry.RegisterForNavigation<FreehandAnnotProperty>(); 
+            containerRegistry.RegisterForNavigation<FreehandAnnotProperty>();
             containerRegistry.RegisterForNavigation<FreetextAnnotProperty>();
             containerRegistry.RegisterForNavigation<ImageAnnotProperty>();
-            containerRegistry.RegisterForNavigation<LinkAnnotProperty>(); 
+            containerRegistry.RegisterForNavigation<LinkAnnotProperty>();
             containerRegistry.RegisterForNavigation<SharpsAnnotProperty>();
             containerRegistry.RegisterForNavigation<StampAnnotProperty>();
             containerRegistry.RegisterForNavigation<TextAnnotProperty>();
@@ -129,9 +137,11 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<DateFillProperty>();
             containerRegistry.RegisterForNavigation<ShapFillProperty>();
             containerRegistry.RegisterForNavigation<TextFillProperty>();
-            #endregion
+
+            #endregion 注册内容组件
 
             #region 注册弹窗
+
             containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
             containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
             containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
@@ -149,7 +159,8 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<HomePagePrinterPageSetDialog>(DialogNames.HomePagePrinterPageSetDialog);
             containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
             containerRegistry.RegisterDialog<AddBookmarkDialog>(DialogNames.AddBookmarkDialog);
-            #endregion
+
+            #endregion 注册弹窗
         }
 
         protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
@@ -203,11 +214,11 @@ namespace PDF_Office
             try
             {
                 /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
-            string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
-            if (licenseerror != LicenseError.ERR_SUCCESS)
-            {
+                string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
+                if (licenseerror != LicenseError.ERR_SUCCESS)
+                {
                 return false;
-            }
+                }
                 CPDFConverter.Init(resPath);*/
                 string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
                 LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);

+ 30 - 22
PDF Office/CustomControl/ColorDropBox.xaml

@@ -1,25 +1,33 @@
-<UserControl x:Class="PDF_Office.CustomControl.ColorDropBox"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.CustomControl"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800" MinWidth="0" Background="#01000000">
+<UserControl
+    x:Class="PDF_Office.CustomControl.ColorDropBox"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    MinWidth="0"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    Background="#01000000"
+    mc:Ignorable="d">
     <Grid>
-        <Ellipse Width="20" Height="20" HorizontalAlignment="Center"  VerticalAlignment="Center">
-                <Ellipse.Fill>
-                    <DrawingBrush>
-                        <DrawingBrush.Drawing>
-                            <ImageDrawing ImageSource="../Resources/PropertyPanel/colorIcon.png">
-                                <ImageDrawing.Rect>
-                                    <Rect Width="16" Height="16"></Rect>
-                                </ImageDrawing.Rect>
-                            </ImageDrawing>
-                        </DrawingBrush.Drawing>
-                    </DrawingBrush>
-                </Ellipse.Fill>
-            </Ellipse>
+        <Ellipse
+            Width="20"
+            Height="20"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Center">
+            <Ellipse.Fill>
+                <DrawingBrush>
+                    <DrawingBrush.Drawing>
+                        <ImageDrawing ImageSource="../Resources/PropertyPanel/colorIcon.png">
+                            <ImageDrawing.Rect>
+                                <Rect Width="16" Height="16" />
+                            </ImageDrawing.Rect>
+                        </ImageDrawing>
+                    </DrawingBrush.Drawing>
+                </DrawingBrush>
+            </Ellipse.Fill>
+        </Ellipse>
     </Grid>
-   
+
 </UserControl>

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

@@ -35,10 +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>

+ 34 - 3
PDF Office/Model/RegionNames.cs

@@ -94,6 +94,39 @@ namespace PDF_Office.Model
             }
         }
 
+        /// <summary>
+        /// 视图模块-分屏视图
+        /// </summary>
+        public static string SplitScreenViewRegionName
+        {
+            get
+            {
+                return GetRegionName("SplitScreenViewRegionName");
+            }
+        }
+
+        /// <summary>
+        /// 视图模块-主题颜色
+        /// </summary>
+        public static string ThemesContentName
+        {
+            get
+            {
+                return GetRegionName("ThemesContentName");
+            }
+        }
+
+        /// <summary>
+        /// 视图模块-阅读模式
+        /// </summary>
+        public static string ReadModeRegionName
+        {
+            get
+            {
+                return GetRegionName("ReadModeRegionName");
+            }
+        }
+
         /// <summary>
         /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
         /// 如果字典里没有键值就新建一个GUID,并插入到
@@ -128,7 +161,5 @@ namespace PDF_Office.Model
                 App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = Value;
             }
         }
-
-
     }
-}
+}

+ 52 - 0
PDF Office/PDF Office.csproj

@@ -265,6 +265,7 @@
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\AddBookmarkDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\BOTA\BookmarkInfoDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModBookletContentViewModel.cs" />
@@ -311,6 +312,10 @@
     <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" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Function.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Properties.cs" />
@@ -327,6 +332,9 @@
     <Compile Include="Views\Dialog\BOTA\AddBookmarkDialog.xaml.cs">
       <DependentUpon>AddBookmarkDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\BOTA\BookmarkInfoDialog.xaml.cs">
+      <DependentUpon>BookmarkInfoDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
       <DependentUpon>FullScreenWindow.xaml</DependentUpon>
     </Compile>
@@ -478,6 +486,18 @@
     <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>
+    <Compile Include="Views\PropertyPanel\ViewModular\ThemesContent.xaml.cs">
+      <DependentUpon>ThemesContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\PropertyPanel\ViewModular\ViewModularContent.xaml.cs">
+      <DependentUpon>ViewModularContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\AnnotToolContent.xaml.cs">
       <DependentUpon>AnnotToolContent.xaml</DependentUpon>
     </Compile>
@@ -519,6 +539,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\ButtonStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\CheckBoxStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\ComboxStyle.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -551,6 +579,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\RadioButtonStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\SliderStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -595,6 +627,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\BOTA\BookmarkInfoDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\FullScreenWindow.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -817,6 +853,22 @@
       <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>
+    </Page>
+    <Page Include="Views\PropertyPanel\ViewModular\ThemesContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\PropertyPanel\ViewModular\ViewModularContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Tools\AnnotToolContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

Datei-Diff unterdrückt, da er zu groß ist
+ 187 - 0
PDF Office/Styles/ButtonStyle.xaml


+ 108 - 0
PDF Office/Styles/CheckBoxStyle.xaml

@@ -0,0 +1,108 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Style x:Key="OptionMarkFocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle
+                        Margin="14,0,0,0"
+                        SnapsToDevicePixels="true"
+                        Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                        StrokeDashArray="1 2"
+                        StrokeThickness="1" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <SolidColorBrush x:Key="OptionMark.Static.Background" Color="#FFFFFFFF" />
+    <SolidColorBrush x:Key="OptionMark.Static.Border" Color="#FF707070" />
+    <SolidColorBrush x:Key="OptionMark.MouseOver.Background" Color="White" />
+    <SolidColorBrush x:Key="OptionMark.MouseOver.Border" Color="Black" />
+    <SolidColorBrush x:Key="OptionMark.MouseOver.Glyph" Color="White" />
+    <SolidColorBrush x:Key="OptionMark.Disabled.Background" Color="#FFE6E6E6" />
+    <SolidColorBrush x:Key="OptionMark.Disabled.Border" Color="#FFBCBCBC" />
+    <SolidColorBrush x:Key="OptionMark.Disabled.Glyph" Color="#FF707070" />
+    <SolidColorBrush x:Key="OptionMark.Pressed.Background" Color="#FFD9ECFF" />
+    <SolidColorBrush x:Key="OptionMark.Pressed.Border" Color="#FF3C77DD" />
+    <SolidColorBrush x:Key="OptionMark.Pressed.Glyph" Color="White" />
+    <SolidColorBrush x:Key="OptionMark.Static.Glyph" Color="White" />
+    <ControlTemplate x:Key="MenuCheckbox" TargetType="{x:Type CheckBox}">
+        <Grid
+            x:Name="templateRoot"
+            Background="Transparent"
+            SnapsToDevicePixels="True">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="Auto" />
+                <ColumnDefinition Width="*" />
+            </Grid.ColumnDefinitions>
+            <Border
+                x:Name="checkBoxBorder"
+                Width="20"
+                Height="20"
+                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                BorderBrush="{TemplateBinding BorderBrush}"
+                BorderThickness="1">
+                <Grid x:Name="markGrid">
+                    <Polygon
+                        x:Name="optionMark"
+                        Width="20"
+                        Height="20"
+                        Margin="1,0,0,0"
+                        VerticalAlignment="Center"
+                        Fill="{StaticResource OptionMark.Static.Glyph}"
+                        Opacity="0"
+                        Points="15.5992424 4.59619408 16.3063492 5.30330086 5.69974747 15.9099026 0.396446609 10.6066017 1.10355339 9.89949494 5.7 14.496" />
+                    <Rectangle
+                        x:Name="indeterminateMark"
+                        Width="20"
+                        Height="20"
+                        Fill="{StaticResource OptionMark.Static.Glyph}"
+                        Opacity="0" />
+                </Grid>
+            </Border>
+            <ContentPresenter
+                x:Name="contentPresenter"
+                Grid.Column="1"
+                Margin="{TemplateBinding Padding}"
+                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                Focusable="False"
+                RecognizesAccessKey="True"
+                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+        </Grid>
+        <ControlTemplate.Triggers>
+            <Trigger Property="HasContent" Value="true">
+                <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                <Setter Property="Padding" Value="4,-1,0,0" />
+            </Trigger>
+            <Trigger Property="IsMouseOver" Value="true">
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.MouseOver.Background}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.MouseOver.Border}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderThickness" Value="2" />
+                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
+                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
+            </Trigger>
+            <Trigger Property="IsEnabled" Value="false">
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Disabled.Background}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Disabled.Border}" />
+                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
+                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
+            </Trigger>
+            <Trigger Property="IsPressed" Value="true">
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
+                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="true">
+                <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="#FF0078D7" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="{x:Null}">
+                <Setter TargetName="optionMark" Property="Opacity" Value="0" />
+                <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+</ResourceDictionary>

+ 8 - 8
PDF Office/Styles/ListViewStyle.xaml

@@ -364,23 +364,23 @@
                             <MultiTrigger.Conditions>
                                 <Condition Property="UIElement.IsMouseOver" Value="True" />
                             </MultiTrigger.Conditions>
-                            <Setter  Property="Panel.Background" Value="#d9d9d9" />
-                            <Setter  Property="Border.BorderBrush" Value="#d9d9d9" />
+                            <Setter Property="Panel.Background" Value="#d9d9d9" />
+                            <Setter Property="Border.BorderBrush" Value="#d9d9d9" />
                         </MultiTrigger>
                         <MultiTrigger>
                             <MultiTrigger.Conditions>
                                 <Condition Property="UIElement.IsMouseOver" Value="False" />
                             </MultiTrigger.Conditions>
-                            <Setter  Property="Panel.Background" Value="#F2F2F2" />
-                            <Setter  Property="Border.BorderBrush" Value="#F2F2F2" />
+                            <Setter Property="Panel.Background" Value="#F2F2F2" />
+                            <Setter Property="Border.BorderBrush" Value="#F2F2F2" />
                         </MultiTrigger>
                         <MultiTrigger>
                             <MultiTrigger.Conditions>
                                 <Condition Property="Selector.IsSelectionActive" Value="False" />
                                 <Condition Property="Selector.IsSelected" Value="True" />
                             </MultiTrigger.Conditions>
-                            <Setter  Property="Panel.Background" Value="#F2F2F2" />
-                            <Setter  Property="Border.BorderBrush" Value="#F2F2F2" />
+                            <Setter Property="Panel.Background" Value="#97D7FB" />
+                            <Setter Property="Border.BorderBrush" Value="#97D7FB" />
                         </MultiTrigger>
 
                         <MultiTrigger>
@@ -388,8 +388,8 @@
                                 <Condition Property="Selector.IsSelectionActive" Value="True" />
                                 <Condition Property="Selector.IsSelected" Value="True" />
                             </MultiTrigger.Conditions>
-                            <Setter  Property="Panel.Background" Value="#97D7FB" />
-                            <Setter  Property="Border.BorderBrush" Value="#97D7FB" />
+                            <Setter Property="Panel.Background" Value="#97D7FB" />
+                            <Setter Property="Border.BorderBrush" Value="#97D7FB" />
                         </MultiTrigger>
                         <!--<Trigger Property="UIElement.IsEnabled" Value="False">
                         <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />

+ 188 - 0
PDF Office/Styles/RadioButtonStyle.xaml

@@ -0,0 +1,188 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Style x:Key="OptionMarkFocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle
+                        Margin="14,0,0,0"
+                        SnapsToDevicePixels="true"
+                        Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                        StrokeDashArray="1 2"
+                        StrokeThickness="1" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <Style x:Key="FocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle
+                        Margin="2"
+                        SnapsToDevicePixels="true"
+                        Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                        StrokeDashArray="1 2"
+                        StrokeThickness="1" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <SolidColorBrush x:Key="RadioButton.Static.Background" Color="#FFFFFFFF" />
+    <SolidColorBrush x:Key="RadioButton.Static.Border" Color="#FF707070" />
+
+    <SolidColorBrush x:Key="RadioButton.MouseOver.Background" Color="#1A000000" />
+    <SolidColorBrush x:Key="RadioButton.MouseOver.Border" Color="#FF5593FF" />
+    <SolidColorBrush x:Key="RadioButton.MouseOver.Glyph" Color="#FFF3F9FF" />
+    <SolidColorBrush x:Key="RadioButton.Disabled.Background" Color="#00000000" />
+    <SolidColorBrush x:Key="RadioButton.Disabled.Border" Color="#FFBCBCBC" />
+    <SolidColorBrush x:Key="RadioButton.Disabled.Glyph" Color="#FF707070" />
+    <SolidColorBrush x:Key="RadioButton.Pressed.Background" Color="#26000000" />
+    <SolidColorBrush x:Key="RadioButton.Pressed.Border" Color="#FF3C77DD" />
+    <SolidColorBrush x:Key="RadioButton.Pressed.Glyph" Color="#1A477EDE" />
+    <SolidColorBrush x:Key="RadioButton.Static.Glyph" Color="#FF212121" />
+    <!--  填充颜色  -->
+    <SolidColorBrush x:Key="Separator.fill" Color="#1A000000" />
+    <SolidColorBrush x:Key="MenuIco.fill" Color="#000000" />
+    <Style x:Key="PageViewRadioBtn" TargetType="{x:Type RadioButton}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
+        <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Width" Value="60" />
+        <Setter Property="Height" Value="80" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Grid
+                        x:Name="templateRoot"
+                        Background="Transparent"
+                        SnapsToDevicePixels="True">
+                        <Border
+                            x:Name="radioButtonBorder"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                            <Rectangle
+                                x:Name="optionMark"
+                                Width="{TemplateBinding Width}"
+                                Height="{TemplateBinding Height}"
+                                Opacity="0" />
+                        </Border>
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="HasContent" Value="true">
+                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                            <Setter Property="Padding" Value="4,-1,0,0" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="{x:Null}">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <Style x:Key="SplitModeViewRadioBtn" TargetType="{x:Type RadioButton}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
+        <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Width" Value="78" />
+        <Setter Property="Height" Value="80" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Grid
+                        x:Name="templateRoot"
+                        Background="Transparent"
+                        SnapsToDevicePixels="True">
+                        <Border
+                            x:Name="radioButtonBorder"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                            <Rectangle
+                                x:Name="optionMark"
+                                Width="{TemplateBinding Width}"
+                                Height="{TemplateBinding Height}"
+                                Opacity="0" />
+                        </Border>
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="HasContent" Value="true">
+                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                            <Setter Property="Padding" Value="4,-1,0,0" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="{x:Null}">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 16 - 1
PDF Office/Styles/TextBoxStyle.xaml

@@ -1 +1,16 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" />
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <Style x:Key="PagesView_txtContext" TargetType="{x:Type TextBlock}">
+        <Setter Property="FontFamily" Value="Segoe UI" />
+        <Setter Property="FontSize" Value="12" />
+    </Style>
+    <Style x:Key="ViewMode_txtContext" TargetType="{x:Type TextBlock}">
+        <Setter Property="FontFamily" Value="Segoe UI" />
+        <Setter Property="FontSize" Value="11" />
+    </Style>
+    <Style x:Key="PagesView_titleContext" TargetType="{x:Type TextBlock}">
+        <Setter Property="FontFamily" Value=" Segoe UI Semibold" />
+        <Setter Property="FontWeight" Value="SemiBold" />
+        <Setter Property="FontSize" Value="14" />
+    </Style>
+</ResourceDictionary>

+ 118 - 198
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -11,6 +11,7 @@ using Prism.Mvvm;
 using Prism.Regions;
 using Prism.Services.Dialogs;
 using System;
+using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Linq;
 using System.Reflection;
@@ -21,9 +22,11 @@ using System.Windows.Forms;
 using System.Windows.Input;
 using System.Windows.Markup;
 using System.Windows.Media;
+using static Dropbox.Api.Files.SearchMatchType;
 using static Dropbox.Api.TeamLog.AdminAlertSeverityEnum;
 using static System.Net.Mime.MediaTypeNames;
 using static System.Windows.Forms.VisualStyles.VisualStyleElement;
+using KeyEventArgs = System.Windows.Input.KeyEventArgs;
 using ListViewItem = System.Windows.Controls.ListViewItem;
 using TextBox = System.Windows.Controls.TextBox;
 
@@ -33,17 +36,13 @@ namespace PDF_Office.ViewModels.BOTA
     {
         #region 属性
 
-        private static string hoverColor = "#D9D9D9";
-        private static string defaultColor = "#F2F2F2";
-        private static string selectColcr = "#97D7FB";
-        private static string borderBackground = "#FFFFFF";
-        private static string borderBrush = "#000000";
-
-        private bool isSelete = false;
         private IRegionManager region;
         private IDialogService dialogs;
         public CPDFViewer PDFViewer;
 
+        /// <summary>
+        /// 书签ItemSouce
+        /// </summary>
         private ObservableCollection<CPDFBookmark> bookmarklist;
 
         public ObservableCollection<CPDFBookmark> Bookmarklist
@@ -58,6 +57,9 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        /// <summary>
+        /// 书签列表为空时,显示状态
+        /// </summary>
         private Visibility isEmpty;
 
         public Visibility IsEmptyPanelVisibility
@@ -76,18 +78,13 @@ namespace PDF_Office.ViewModels.BOTA
 
         #region 命令
 
-        public DelegateCommand<object> MouseClickCommand { get; set; }
-        public DelegateCommand<object> MouseEnterCommand { get; set; }
-        public DelegateCommand<object> MouseLeaveCommand { get; set; }
+        public DelegateCommand<object> KeyDownCommand { get; set; }
 
         public DelegateCommand<object> LostFocusCommand { get; set; }
 
-        public DelegateCommand<object> GotFocusCommand { get; set; }
-
         public DelegateCommand<object> AddBookmarkCommand { get; set; }
 
         public DelegateCommand<object> ListViewItemMouseDownCommand { get; set; }
-        public DelegateCommand<object> RenameCommand { get; set; }
 
         public DelegateCommand<object> EditPageIndexCommand { get; set; }
 
@@ -100,94 +97,130 @@ namespace PDF_Office.ViewModels.BOTA
             region = regionManager;
             dialogs = dialogService;
 
-            //MouseClickCommand = new DelegateCommand<object>(MouseClickEvent);
-            //MouseEnterCommand = new DelegateCommand<object>(MouseEnterEvent);
+            Bookmarklist = new ObservableCollection<CPDFBookmark>();
+
             LostFocusCommand = new DelegateCommand<object>(LostFocusEvent);
-            //MouseLeaveCommand = new DelegateCommand<object>(MouseLeaveEvent);
-            //GotFocusCommand = new DelegateCommand<object>(GotFocusEvent);
+
             AddBookmarkCommand = new DelegateCommand<object>(AddBookmarkEvent);
             ListViewItemMouseDownCommand = new DelegateCommand<object>(ListViewItemMouseLeftButtonDownEvent);
-            RenameCommand = new DelegateCommand<object>(RenameEvent);
+
             DeleteCommand = new DelegateCommand<object>(DelegateEvent);
             EditPageIndexCommand = new DelegateCommand<object>(EditPageIndexEvent);
+            KeyDownCommand = new DelegateCommand<object>(KeyDownEvent);
         }
 
-        private void EditPageIndexEvent(object obj)
+        /// <summary>
+        /// 检测ObservableCollection的数据变更
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void Bookmarklist_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
         {
-            CPDFBookmark bookmark = obj as CPDFBookmark;
-            if (bookmark != null)
+            ObservableCollection<CPDFBookmark> obsSender = sender as ObservableCollection<CPDFBookmark>;
+            if (obsSender != null)
             {
-                if (RemoveBookMark(bookmark))
+                if (obsSender.Count < 1)
                 {
-                    bookmarklist.Remove(bookmark);
-
-                    CPDFBookmark cPDFBookmark = new CPDFBookmark();
-                    bookmark.Title = bookmark.Title;
-                    bookmark.Date = DateTime.Now.ToString(@"yyyyMMddHHmmsszzz\'").Replace(':', '\'') + "\n";
-                    bookmark.PageIndex = PDFViewer.CurrentIndex;
+                    IsEmptyPanelVisibility = Visibility.Visible;
+                }
+                else
+                {
+                    IsEmptyPanelVisibility = Visibility.Collapsed;
+                }
+            }
+        }
 
-                    if (PDFViewer.Document.AddBookmark(bookmark))
+        /// <summary>
+        /// 文本框按下Enter键
+        /// </summary>
+        /// <param name="obj"></param>
+        private void KeyDownEvent(object obj)
+        {
+            if (obj is KeyEventArgs)
+            {
+                KeyEventArgs keyEventArgs = (KeyEventArgs)obj;
+                if (keyEventArgs.Key == Key.Enter)
+                {
+                    if (keyEventArgs.OriginalSource is TextBox)
                     {
-                        PDFViewer.UndoManager.CanSave = true;
-
-                        Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.Title));
+                        TextBox textBox = (TextBox)keyEventArgs.OriginalSource;
+                        ListViewItem listViewItem = CommonHelper.FindVisualParent<ListViewItem>(textBox);
+                        UpdateTitle(listViewItem, textBox);
+                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listViewItem);
+                        textBlock.Text = textBox.Text;
+                        textBlock.Visibility = Visibility.Visible;
                     }
                 }
-
-                //var list = PDFViewer.Document.GetBookmarkList().FindAll(q => q.PageIndex == bookmark.PageIndex && q.Title==bookmark.Title);
-                //CPDFBookmark cPDF = list[0];
-                //cPDF.PageIndex = PDFViewer.CurrentIndex;
             }
         }
 
-        private void DelegateEvent(object obj)
+        /// <summary>
+        /// 重新定位
+        /// </summary>
+        /// <param name="obj"></param>
+        private void EditPageIndexEvent(object obj)
         {
             CPDFBookmark bookmark = obj as CPDFBookmark;
             if (bookmark != null)
             {
-                if (RemoveBookMark(bookmark))
-                    bookmarklist.Remove(bookmark);
-                //ListBoxItem myListBoxItem = (ListBoxItem)(myListBox.ItemContainerGenerator.ContainerFromItem(myListBox.Items.CurrentItem));
+                AlertsMessage alertsMessage = new AlertsMessage();
+                alertsMessage.ShowDialog("提示", "确定要将选定大纲的目标位置设置为当前位置吗?", "Cancel", "OK");
+                if (alertsMessage.result == ContentResult.Ok)
+                {
+                    if (RemoveBookMark(bookmark))
+                    {
+                        bookmarklist.Remove(bookmark);
+
+                        CPDFBookmark cPDFBookmark = new CPDFBookmark();
+                        bookmark.Title = bookmark.Title;
+                        bookmark.Date = DateTime.Now.ToString(@"yyyyMMddHHmmsszzz\'").Replace(':', '\'') + "\n";
+                        bookmark.PageIndex = PDFViewer.CurrentIndex;
+
+                        if (PDFViewer.Document.AddBookmark(bookmark))
+                        {
+                            PDFViewer.UndoManager.CanSave = true;
+                            Bookmarklist.Add(bookmark);
+                        }
+                    }
+                }
             }
         }
 
-        private void RenameEvent(object obj)
+        /// <summary>
+        /// 右键菜单-删除
+        /// </summary>
+        /// <param name="obj"></param>
+        private void DelegateEvent(object obj)
         {
             CPDFBookmark bookmark = obj as CPDFBookmark;
             if (bookmark != null)
             {
-                //var result = PDFViewer.Document.EditBookmark(bookmark.PageIndex, textBox.Text.Trim());
-                //if (result)
-                //{
-                //    bookmark.Title = textBox.Text.Trim();
-                //    PDFViewer.UndoManager.CanSave = true;
-                //}
+                if (RemoveBookMark(bookmark))
+                {
+                    Bookmarklist.Remove(bookmark);
+                }
             }
         }
 
+        /// <summary>
+        /// 删除书签
+        /// </summary>
+        /// <param name="item"></param>
+        /// <returns></returns>
         private bool RemoveBookMark(CPDFBookmark item)
         {
             var data = item;
             if (data == null)
-                return false;
-            return PDFViewer.Document.RemoveBookmark(data.PageIndex);
-        }
-
-        private void GotFocusEvent(object obj)
-        {
-            if (obj is CompositeCommandParameter)
             {
-                CompositeCommandParameter parameter = (CompositeCommandParameter)obj;
-                if (parameter.Parameter is TextBox)
-                {
-                    TextBox textBox = (TextBox)parameter.Parameter;
-
-                    textBox.SelectAll();
-                    textBox.PreviewMouseDown -= new MouseButtonEventHandler(TxtTitleInput_PreviewMouseLeftButtonDown);
-                }
+                return false;
             }
+            return PDFViewer.Document.RemoveBookmark(data.PageIndex);
         }
 
+        /// <summary>
+        /// ListViewItem失去焦点
+        /// </summary>
+        /// <param name="obj"></param>
         private void LostFocusEvent(object obj)
         {
             TextBox textBox = null;
@@ -198,8 +231,6 @@ namespace PDF_Office.ViewModels.BOTA
                 if (parameter.Parameter is TextBox)
                 {
                     textBox = (TextBox)parameter.Parameter;
-                    //textBox.PreviewMouseDown += new MouseButtonEventHandler(TxtTitleInput_PreviewMouseLeftButtonDown);
-
                     listViewItem = CommonHelper.FindVisualParent<ListViewItem>(textBox);
                 }
             }
@@ -208,11 +239,23 @@ namespace PDF_Office.ViewModels.BOTA
                 listViewItem = (ListViewItem)(obj);
                 textBox = CommonHelper.FindVisualChild<TextBox>(listViewItem);
             }
+            UpdateTitle(listViewItem, textBox);
+        }
+
+        /// <summary>
+        /// 修改书签标题
+        /// </summary>
+        /// <param name="listViewItem"></param>
+        /// <param name="textBox"></param>
+        private void UpdateTitle(ListViewItem listViewItem, TextBox textBox)
+        {
             if (listViewItem != null)
             {
                 var data = listViewItem.DataContext as CPDFBookmark;
                 if (data == null)
+                {
                     return;
+                }
                 var result = PDFViewer.Document.EditBookmark(data.PageIndex, textBox.Text.Trim());
                 if (result)
                 {
@@ -222,91 +265,29 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
-        private void TxtTitleInput_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            TextBox textBox = sender as TextBox;
-            textBox.Focus();
-            e.Handled = true;
-        }
-
+        /// <summary>
+        /// ListBoxItem左键单击,页面跳转
+        /// </summary>
+        /// <param name="obj"></param>
         private void ListViewItemMouseLeftButtonDownEvent(object obj)
         {
             ListBoxItem listBoxItem = (obj as ListBoxItem);
 
             if (listBoxItem != null)
             {
-                //box.Background = listBoxItem.Background;
-                //box.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectColcr));
                 if (!(listBoxItem.DataContext is CPDFBookmark))
                 {
                     return;
                 }
                 int index = (listBoxItem.DataContext as CPDFBookmark).PageIndex;
                 PDFViewer.GoToPage(index);
-                isSelete = false;
-            }
-            //MessageBox.Show("dsafa");
-        }
-
-        private void MouseLeaveEvent(object obj)
-        {
-            if (obj is CompositeCommandParameter)
-            {
-                CompositeCommandParameter parameter = (CompositeCommandParameter)obj;
-                if (parameter.Parameter is Grid)
-                {
-                    Grid grid = parameter.Parameter as Grid;
-                    if (grid != null)
-                    {
-                        TextBlock box = CommonHelper.FindVisualChild<TextBlock>(grid);
-
-                        ListBoxItem myListBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(grid);
-                        box.Visibility = Visibility.Visible;
-                        //if (myListBoxItem.IsSelected == true)
-                        //{
-                        //    box.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(defaultColor));
-                        //}
-                        //if (myListBoxItem.IsMouseOver == true)
-                        //{
-                        //    box.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(defaultColor));
-                        //}
-                        //else
-                        //{
-                        //    box.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(defaultColor));
-                        //}
-                        //myListBoxItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(defaultColor));
-                        //grid.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(defaultColor));
-                    }
-                }
-            }
-        }
-
-        public void MouseEnterEvent(object obj)
-        {
-            if (obj is CompositeCommandParameter)
-            {
-                CompositeCommandParameter parameter = (CompositeCommandParameter)obj;
-                if (parameter.Parameter is Grid)
-                {
-                    Grid grid = parameter.Parameter as Grid;
-                    if (grid != null)
-                    {
-                        TextBlock box = CommonHelper.FindVisualChild<TextBlock>(grid);
-                        ListBoxItem listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(grid);
-                        if (box != null)
-                        {
-                            box.Visibility = Visibility.Visible;
-                            //box.Background = listBoxItem.Background;
-                            //box.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(hoverColor));
-                        }
-
-                        //myListBoxItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(hoverColor));
-                        //grid.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(hoverColor));
-                    }
-                }
             }
         }
 
+        /// <summary>
+        /// 添加书签
+        /// </summary>
+        /// <param name="obj"></param>
         private void AddBookmarkEvent(object obj)
         {
             int index = PDFViewer.CurrentIndex;
@@ -319,23 +300,13 @@ namespace PDF_Office.ViewModels.BOTA
                 System.Windows.Controls.ListView listView = obj as System.Windows.Controls.ListView;
                 if (listView != null)
                 {
-                    //listView.Items.CurrentItem = list[0];
                     ListBoxItem myListBoxItem = (ListBoxItem)(listView.ItemContainerGenerator.ContainerFromItem(list[0]));
 
-                    //ContentPresenter myContentPresenter = CommonHelper.FindVisualChild<ContentPresenter>(myListBoxItem);
-                    //DataTemplate myDataTemplate = myContentPresenter.ContentTemplate;
-                    //Grid item = (Grid)myDataTemplate.FindName("Grid", myContentPresenter);
-
-                    //Grid grid = CommonHelper.FindVisualChild<Grid>(myListBoxItem);
                     if (myListBoxItem.IsSelected == false)
                     {
                         myListBoxItem.IsSelected = true;
                         myListBoxItem.Focus();
                     }
-
-                    //listView.SelectedItem = myListBoxItem;
-
-                    //myListBoxItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectColcr));
                     return;
                 }
             }
@@ -358,75 +329,24 @@ namespace PDF_Office.ViewModels.BOTA
                         {
                             PDFViewer.UndoManager.CanSave = true;
 
-                            Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.Title));
+                            Bookmarklist.Add(bookmark);
                         }
                     }
                 }
             });
         }
 
-        public void MouseClickEvent(object obj)
-        {
-            if (obj is MouseButtonEventArgs)
-            {
-                var mouse = (MouseButtonEventArgs)obj;
-                if (mouse.LeftButton == MouseButtonState.Pressed)
-                {
-                    TextBlock box = null;
-                    Grid grid = null;
-                    if (mouse.ClickCount >= 2)
-                    {
-                        if (mouse.Source is Grid)
-                        {
-                            grid = mouse.Source as Grid;
-                            //grid.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectColcr));
-                            if (grid != null)
-                            {
-                                box = CommonHelper.FindVisualChild<TextBlock>(grid);
-                                //grid.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectColcr));
-                                if (box != null)
-                                {
-                                    box.Visibility = Visibility.Collapsed;
-                                    //TextBox textBox = CommonHelper.FindVisualChild<TextBox>((box.Parent as StackPanel));
-                                    //FocusManager.SetFocusedElement(box.Parent, textBox);
-                                    //Keyboard.Focus(textBox);
-                                    //textBox.IsHitTestVisible = true;
-                                    //textBox.Focus();
-                                }
-                            }
-                        }
-                        if (mouse.Source is TextBlock)
-                        {
-                            box = (TextBlock)mouse.Source;
-                            grid = (box.Parent as StackPanel).Parent as Grid;
-
-                            //grid.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(selectColcr));
-                            if (box != null)
-                            {
-                                box.Visibility = Visibility.Collapsed;
-                                //TextBox textBox = CommonHelper.FindVisualChild<TextBox>((box.Parent as StackPanel));
-                                //FocusManager.SetFocusedElement(box.Parent, textBox);
-                                //Keyboard.Focus(textBox);
-                                //textBox.IsHitTestVisible = true;
-                                //textBox.Focus();
-                            }
-                        }
-                    }
-
-                    //MessageBox.Show("dsafa");
-                }
-            }
-        }
-
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             if (PDFViewer == null)
             {
+                IsEmptyPanelVisibility = Visibility.Visible;
                 return;
             }
 
             Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.Title));
+            Bookmarklist.CollectionChanged += Bookmarklist_CollectionChanged;
             if (Bookmarklist.Count < 1)
             {
                 IsEmptyPanelVisibility = Visibility.Visible;

+ 70 - 36
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -20,7 +20,6 @@ namespace PDF_Office.ViewModels
 {
     public class BottomToolContentViewModel : BindableBase, INavigationAware
     {
-
         public DelegateCommand Load { get; set; }
 
         public DelegateCommand FirstPageCommand { get; set; }
@@ -53,6 +52,22 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand<object> SelectionChangedCommand { get; set; }
 
+        public DelegateCommand<object> ShowViewModularCommand { get; set; }
+
+        private bool isShowViewModular = false;
+
+        /// <summary>
+        /// 属性栏是否展开
+        /// </summary>
+        public bool IsShowViewModular
+        {
+            get { return isShowViewModular; }
+            set
+            {
+                SetProperty(ref isShowViewModular, value);
+            }
+        }
+
         private bool isSingleView;
 
         public bool IsSingleView
@@ -151,18 +166,15 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
-
         public CPDFViewer PDFViewer { get; set; }
 
         private ViewContentViewModel viewContentViewModel { get; set; }
 
-
         private IRegionManager region;
 
         private IDialogService dialogs;
 
-        public BottomToolContentViewModel(IRegionManager regionManager,IDialogService dialogService)
+        public BottomToolContentViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
             region = regionManager;
             dialogs = dialogService;
@@ -171,13 +183,32 @@ namespace PDF_Office.ViewModels
             NextPageCommand = new DelegateCommand(GoNextPage, CanNextPageExcute).ObservesProperty(() => CurrentPage);
             FirstPageCommand = new DelegateCommand(GoFirstPage, CanPrePageExcute).ObservesProperty(() => CurrentPage);
             LastPageCommand = new DelegateCommand(GoLastPage, CanNextPageExcute).ObservesProperty(() => CurrentPage);
-            ZoomInCommand = new DelegateCommand(ZoomIn, CanZoomIn).ObservesProperty(()=>CurrentZoom);
-            ZoomOutCommand = new DelegateCommand(ZoomOut, CanZoomOut).ObservesProperty(()=>CurrentZoom);
+            ZoomInCommand = new DelegateCommand(ZoomIn, CanZoomIn).ObservesProperty(() => CurrentZoom);
+            ZoomOutCommand = new DelegateCommand(ZoomOut, CanZoomOut).ObservesProperty(() => CurrentZoom);
             SetViewModeCommand = new DelegateCommand(SetModeView);
             PageTextKeyDownCommand = new DelegateCommand<object>(PageNumText_KeyDown);
             PageTextPreviewKeyDownCommand = new DelegateCommand<object>(PageNumText_PreviewKeyDown);
             SelectionChangedCommand = new DelegateCommand<object>(SelectionChangedEvent);
             OpenFullCommand = new DelegateCommand(OpenFullWindow);
+            ShowViewModularCommand = new DelegateCommand<object>(ShowViewModularEvent);
+        }
+
+        private void ShowViewModularEvent(object obj)
+        {
+            if (viewContentViewModel.IsPropertyOpen == false)
+            {
+                viewContentViewModel.IsPropertyOpen = true;
+
+                NavigationParameters param = new NavigationParameters();
+                param.Add(ParameterNames.PDFViewer, PDFViewer);
+                param.Add(ParameterNames.BottomToolContentViewModel, this);
+                region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
+            }
+            else
+            {
+                viewContentViewModel.IsPropertyOpen = false;
+            }
+            IsShowViewModular = viewContentViewModel.IsPropertyOpen;
         }
 
         /// <summary>
@@ -187,14 +218,15 @@ namespace PDF_Office.ViewModels
         {
             DialogParameters parameters = new DialogParameters();
             //因为全屏模式可能需要设置特定的页面模式,所以只传文件路径,新建一个PDFview对象
-            parameters.Add(ParameterNames.FilePath,PDFViewer.Document.FilePath);
-            parameters.Add(ParameterNames.PassWord,PDFViewer.Tag==null?"":PDFViewer.Tag.ToString());
-            dialogs.ShowDialog(DialogNames.FullScreenDialog,parameters,e=> { 
-                if(e.Result==ButtonResult.Cancel)
+            parameters.Add(ParameterNames.FilePath, PDFViewer.Document.FilePath);
+            parameters.Add(ParameterNames.PassWord, PDFViewer.Tag == null ? "" : PDFViewer.Tag.ToString());
+            dialogs.ShowDialog(DialogNames.FullScreenDialog, parameters, e =>
+            {
+                if (e.Result == ButtonResult.Cancel)
                 {
                     //TODO:弹窗提示打开全屏模式失败
                     AlertsMessage alertsMessage = new AlertsMessage();
-                    alertsMessage.ShowDialog("","Error","OK");
+                    alertsMessage.ShowDialog("", "Error", "OK");
                     return;
                 }
             });
@@ -203,21 +235,24 @@ namespace PDF_Office.ViewModels
         private void SelectionChangedEvent(object e)
         {
             var args = e as SelectionChangedEventArgs;
-            if(args!=null)
+            if (args != null)
             {
-                if(SelectedIndex<=2)
+                if (SelectedIndex <= 2)
                 {
                     switch (SelectedIndex)
                     {
                         case 0:
                             PDFViewer.ChangeFitMode(FitMode.FitSize);
                             break;
+
                         case 1:
                             PDFViewer.ChangeFitMode(FitMode.FitWidth);
                             break;
+
                         case 2:
                             PDFViewer.ChangeFitMode(FitMode.FitHeight);
                             break;
+
                         default:
                             break;
                     }
@@ -232,14 +267,13 @@ namespace PDF_Office.ViewModels
                         }
                     }
                 }
-    
             }
         }
 
         private void PageNumText_PreviewKeyDown(object e)
         {
             var args = e as KeyEventArgs;
-            if(args != null)
+            if (args != null)
             {
                 //显示文本框输入内容
                 List<Key> NumberKeys = new List<Key>() { Key.D0,Key.D1,Key.D2,Key.D3,Key.D4,Key.D5,Key.D6,Key.D7,Key.D8,Key.D9,Key.NumPad0,Key.NumPad1,Key.NumPad2,
@@ -302,13 +336,12 @@ namespace PDF_Office.ViewModels
             return false;
         }
 
-
         private void GoNextPage()
         {
             if (PDFViewer != null)
             {
                 PDFViewer.GoToPage(PDFViewer.CurrentIndex + 1);
-                if(((int)PDFViewer.Mode%2)==0)
+                if (((int)PDFViewer.Mode % 2) == 0)
                 {
                     PDFViewer.GoToPage(PDFViewer.CurrentIndex + 2);
                 }
@@ -345,7 +378,7 @@ namespace PDF_Office.ViewModels
 
         private void ZoomIn()
         {
-            var zoom = PDFViewer.ZoomFactor*100;
+            var zoom = PDFViewer.ZoomFactor * 100;
             if (zoom >= 1 && zoom <= 100)
             {
                 PDFViewer.Zoom((zoom + 5) / 100.0);
@@ -362,10 +395,10 @@ namespace PDF_Office.ViewModels
 
         private void ZoomOut()
         {
-            var zoom = PDFViewer.ZoomFactor*100;
+            var zoom = PDFViewer.ZoomFactor * 100;
             if (zoom >= 1 && zoom <= 100)
             {
-                PDFViewer.Zoom((zoom - 5)/100.0);
+                PDFViewer.Zoom((zoom - 5) / 100.0);
             }
             else if (zoom <= 500)
             {
@@ -381,7 +414,7 @@ namespace PDF_Office.ViewModels
         {
             if (PDFViewer != null)
             {
-                if (PDFViewer.ZoomFactor*100 >=1000)
+                if (PDFViewer.ZoomFactor * 100 >= 1000)
                     return false;
                 else
                     return true;
@@ -393,7 +426,7 @@ namespace PDF_Office.ViewModels
         {
             if (PDFViewer != null)
             {
-                if (PDFViewer.ZoomFactor*100 <=1)
+                if (PDFViewer.ZoomFactor * 100 <= 1)
                     return false;
                 else
                     return true;
@@ -401,7 +434,7 @@ namespace PDF_Office.ViewModels
             return false;
         }
 
-        private void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
+        public void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
         {
             if (e.Key == "PageNum")
             {
@@ -412,9 +445,9 @@ namespace PDF_Office.ViewModels
             {
                 GetModeView((ViewMode)e.Value);
             }
-            if(e.Key=="Zoom")
+            if (e.Key == "Zoom")
             {
-                CurrentZoom = (double)e.Value*100;
+                CurrentZoom = (double)e.Value * 100;
                 SelectedIndex = -1;
             }
         }
@@ -423,11 +456,10 @@ namespace PDF_Office.ViewModels
         {
             if ((int)mode % 2 == 0)
             {
-                if(!IsContinue)
+                if (!IsContinue)
                 {
                     IsContinue = true;
                 }
-               
             }
             else
             {
@@ -439,28 +471,28 @@ namespace PDF_Office.ViewModels
 
             if ((int)mode <= 2)
             {
-                if(!isSingleView)
+                if (!isSingleView)
                 {
                     IsSingleView = true;
                 }
             }
             else if ((int)mode <= 4)
             {
-                if(!isDoubleView)
+                if (!isDoubleView)
                 {
                     IsDoubleView = true;
                 }
             }
             else
             {
-                if(!isBookMode)
+                if (!isBookMode)
                 {
                     IsBookMode = true;
                 }
             }
         }
 
-        private void SetModeView()
+        public void SetModeView()
         {
             if (PDFViewer != null)
             {
@@ -498,16 +530,18 @@ namespace PDF_Office.ViewModels
         }
 
         #region Navigation
+
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             var viewContentViewModel = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as ViewContentViewModel;
             if (viewContentViewModel != null)
             {
                 this.viewContentViewModel = viewContentViewModel;
+                IsShowViewModular = viewContentViewModel.IsPropertyOpen;
             }
 
             var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
-            if(pdfview!=null)
+            if (pdfview != null)
             {
                 //获取页面设置等信息
                 PDFViewer = pdfview;
@@ -526,8 +560,8 @@ namespace PDF_Office.ViewModels
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
-
         }
-        #endregion
+
+        #endregion Navigation
     }
-}
+}

+ 63 - 3
PDF Office/ViewModels/Dialog/BOTA/BookmarkInfoDialogViewModel.cs

@@ -1,4 +1,9 @@
-using System;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -6,7 +11,62 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.ViewModels.Dialog.BOTA
 {
-    internal class BookmarkInfoDialogViewModel
+    internal class BookmarkInfoDialogViewModel : BindableBase, IDialogAware
     {
+        private string bookmarkInfo;
+
+        public string BookmarkInfo
+        {
+            get { return bookmarkInfo; }
+            set
+            {
+                SetProperty(ref bookmarkInfo, value);
+            }
+        }
+
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand OkCommnad { get; set; }
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public BookmarkInfoDialogViewModel()
+        {
+            CancelCommand = new DelegateCommand(CancelEvent);
+            OkCommnad = new DelegateCommand(OkEvent);
+        }
+
+        private void CancelEvent()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        private void OkEvent()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.OK));
+        }
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            string mark;
+            parameters.TryGetValue<string>(ParameterNames.BookmarkInfo, out mark);
+            BookmarkInfo = mark;
+
+            //string title;
+            //parameters.TryGetValue<string>(ParameterNames.Title, out title);
+            //Title = title;
+            return;
+        }
     }
-}
+}

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

@@ -0,0 +1,210 @@
+using ComPDFKitViewer.PdfViewer;
+using Dropbox.Api.Sharing;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+using System.Windows.Forms;
+using System.Windows.Input;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrayNotify;
+using System.Windows.Media;
+using KeyEventArgs = System.Windows.Input.KeyEventArgs;
+using TextBox = System.Windows.Controls.TextBox;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
+
+namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
+{
+    public class ReadModeContentViewModel : BindableBase, INavigationAware
+    {
+        private ViewContentViewModel viewContentViewModel;
+        private CPDFViewer PDFViewer;
+
+        private int currentPage;
+
+        public int CurrentPage
+        {
+            get { return currentPage; }
+            set
+            {
+                SetProperty(ref currentPage, value);
+            }
+        }
+
+        private int pageCount;
+
+        public int PageCount
+        {
+            get { return pageCount; }
+            set
+            {
+                SetProperty(ref pageCount, value);
+            }
+        }
+
+        public DelegateCommand<object> KeyDownCommand { get; set; }
+        public DelegateCommand<object> PreviewKeyDownCommand { get; set; }
+        public DelegateCommand<object> ZoomOutCommand { get; set; }
+        public DelegateCommand<object> ZoomInCommand { get; set; }
+        public DelegateCommand<object> PrePageCommand { get; set; }
+        public DelegateCommand<object> NextPageCommand { get; set; }
+
+        public ReadModeContentViewModel()
+        {
+            KeyDownCommand = new DelegateCommand<object>(KeyDownEvent);
+            PreviewKeyDownCommand = new DelegateCommand<object>(PreviewKeyDownEvent);
+            ZoomOutCommand = new DelegateCommand<object>(PageZoomOutEvent);
+            ZoomInCommand = new DelegateCommand<object>(PageZoomInEvent);
+
+            PrePageCommand = new DelegateCommand<object>(PrePageEvent);
+            NextPageCommand = new DelegateCommand<object>(NextPageEvent);
+        }
+
+        private void NextPageEvent(object obj)
+        {
+            if (PDFViewer.ModeView == ComPDFKitViewer.ViewMode.Double || PDFViewer.ModeView == ComPDFKitViewer.ViewMode.DoubleContinuous || PDFViewer.ModeView == ComPDFKitViewer.ViewMode.Book || PDFViewer.ModeView == ComPDFKitViewer.ViewMode.BookContinuous)
+
+            {
+                PDFViewer.GoToPage(PDFViewer.CurrentIndex + 2);
+            }
+            else
+                PDFViewer.GoToPage(PDFViewer.CurrentIndex + 1);
+        }
+
+        private void PrePageEvent(object obj)
+        {
+            if (PDFViewer.ModeView == ComPDFKitViewer.ViewMode.Double || PDFViewer.ModeView == ComPDFKitViewer.ViewMode.DoubleContinuous || PDFViewer.ModeView == ComPDFKitViewer.ViewMode.Book || PDFViewer.ModeView == ComPDFKitViewer.ViewMode.BookContinuous)
+            {
+                PDFViewer.GoToPage(PDFViewer.CurrentIndex - 1);
+            }
+            else
+            {
+                PDFViewer.GoToPage(PDFViewer.CurrentIndex - 1);
+            }
+        }
+
+        private void PageZoomInEvent(object obj)
+        {
+            double zoom = PDFViewer.ZoomFactor * 100;
+            zoom = zoom + 25;
+            if (zoom != 0 && zoom <= 1000 && PDFViewer != null)
+            {
+                PDFViewer.Zoom(zoom / 100);
+            }
+        }
+
+        private void PageZoomOutEvent(object obj)
+        {
+            double zoom = PDFViewer.ZoomFactor * 100;
+            zoom = zoom - 25;
+            if (zoom != 0 && PDFViewer != null)
+            {
+                PDFViewer.Zoom(zoom / 100);
+            }
+        }
+
+        private void PreviewKeyDownEvent(object obj)
+        {
+            var args = obj as KeyEventArgs;
+            if (args != null)
+            {
+                //显示文本框输入内容
+                List<Key> NumberKeys = new List<Key>() { Key.D0,Key.D1,Key.D2,Key.D3,Key.D4,Key.D5,Key.D6,Key.D7,Key.D8,Key.D9,Key.NumPad0,Key.NumPad1,Key.NumPad2,Key.NumPad3,Key.NumPad4,Key.NumPad5,Key.NumPad6,Key.NumPad7,Key.NumPad8,Key.NumPad9,Key.Delete,Key.Back,Key.Enter,Key.Right,Key.Left};
+                if (!NumberKeys.Contains(args.Key))
+                {
+                    args.Handled = true;
+                }
+            }
+        }
+
+        private void KeyDownEvent(object obj)
+        {
+            if (obj is CompositeCommandParameter objs)
+            {
+                if (objs.EventArgs is System.Windows.Input.KeyEventArgs keyEventArgs)
+                {
+                    TextBlock textBlock = objs.Parameter as TextBlock;
+                    if (keyEventArgs.Key == Key.Enter)
+                    {
+                        if (keyEventArgs.OriginalSource is System.Windows.Controls.TextBox txtCurrentPageNum)
+                        {
+                            int pagenum = 0;
+                            string text = txtCurrentPageNum.Text.ToString();
+                            char[] chs = { ' ', '/', '\\' };//字符截取  拒止非法输入
+                            int i = text.LastIndexOfAny(chs);
+                            if (i > 0)
+                            {
+                                text = text.Substring(0, i - 1);
+                            }
+                            if (!int.TryParse(text, out pagenum))
+                            {
+                                CurrentPage = PDFViewer.Document.PageCount;
+                                txtCurrentPageNum.Text = PDFViewer.Document.PageCount.ToString();
+                                return;
+                            }
+                            if (pagenum < 1)
+                            {
+                                pagenum = 1;
+                            }
+                            else if (pagenum > PDFViewer.Document.PageCount)
+                            {
+                                pagenum = PDFViewer.Document.PageCount;
+                            }
+
+                            PDFViewer.GoToPage(pagenum - 1);
+                            CurrentPage = pagenum;
+                            txtCurrentPageNum.Text = pagenum.ToString();
+                            textBlock.Visibility = System.Windows.Visibility.Visible;
+                            txtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
+                            txtCurrentPageNum.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
+                        }
+                    }
+                }
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var viewContentViewModel = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as ViewContentViewModel;
+            if (viewContentViewModel != null)
+            {
+                this.viewContentViewModel = viewContentViewModel;
+            }
+            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            if (pdfview != null)
+            {
+                //获取页面设置等信息
+                this.PDFViewer = pdfview;
+                PageCount = PDFViewer.Document.PageCount;
+                CurrentPage = PDFViewer.CurrentIndex + 1;
+                this.PDFViewer.InfoChanged += PDFViewer_InfoChanged;
+            }
+        }
+
+        private void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
+        {
+            if (e.Key == "SplieMode" || e.Key == "ViewMode")
+            {
+                return;
+            }
+            PageCount = PDFViewer.Document.PageCount;
+            CurrentPage = PDFViewer.CurrentIndex + 1;
+        }
+    }
+}

+ 26 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/SplitScreenContentViewModel.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
+{
+    internal class SplitScreenContentViewModel : BindableBase, INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

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

@@ -0,0 +1,257 @@
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Properties;
+using PDF_Office.Views.PropertyPanel.ViewModular;
+using PDFSettings.Settings;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+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.Documents;
+using System.Windows.Forms;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Shapes;
+using static PDF_Office.CustomControl.ColorDropBox;
+using RadioButton = System.Windows.Controls.RadioButton;
+
+namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
+{
+    public class ThemesContentViewModel : BindableBase, INavigationAware
+    {
+        public CPDFViewer PDFViewer { get; set; }
+        public Color? SelectedColor { get; set; }
+        private bool resedaDrawMode;
+
+        public bool ResedaDrawMode
+        {
+            get { return resedaDrawMode; }
+            set
+            {
+                SetProperty(ref resedaDrawMode, value);
+                if (value)
+                {
+                    SetDrawModeEvent(null);
+                }
+            }
+        }
+
+        private bool darkDrawMode;
+
+        public bool DarkDrawMode
+        {
+            get { return darkDrawMode; }
+            set
+            {
+                SetProperty(ref darkDrawMode, value);
+                if (value)
+                {
+                    SetDrawModeEvent(null);
+                }
+            }
+        }
+
+        private bool sepiaDrawMode;
+
+        public bool SepiaDrawMode
+        {
+            get { return sepiaDrawMode; }
+            set
+            {
+                SetProperty(ref sepiaDrawMode, value);
+                if (value)
+                {
+                    SetDrawModeEvent(null);
+                }
+            }
+        }
+
+        private bool lightDrawMode;
+
+        public bool LightDrawMode
+        {
+            get { return lightDrawMode; }
+            set
+            {
+                SetProperty(ref lightDrawMode, value);
+                if (value)
+                {
+                    SetDrawModeEvent(null);
+                }
+            }
+        }
+
+        public DelegateCommand<object> LoadedCommand { get; set; }
+        public DelegateCommand<object> SetDrawModeCommand { get; set; }
+
+        public ThemesContentViewModel()
+        {
+            LoadedCommand = new DelegateCommand<object>(LoadedEvent);
+
+            SetDrawModeCommand = new DelegateCommand<object>(SetDrawModeEvent);
+        }
+
+        private void LoadedEvent(object obj)
+        {
+            if (obj is WrapPanel wrapPanel)
+            {
+                InitBeforeShow(wrapPanel);
+            }
+        }
+
+        /// <summary>
+        /// 设置主题颜色
+        /// </summary>
+        /// <param name="obj"></param>
+        private void SetDrawModeEvent(object obj)
+        {
+            //if (obj is RadioButton radioButton)
+            //{
+            //    bool sepia = radioButton.Name.IndexOf(ThemesDrawMode.Sepia.ToString(), StringComparison.OrdinalIgnoreCase) >= 0;
+            //    bool light = radioButton.Name.IndexOf(ThemesDrawMode.Light.ToString(), StringComparison.OrdinalIgnoreCase) >= 0;
+            //    bool reseda = radioButton.Name.IndexOf(ThemesDrawMode.Reseda.ToString(), StringComparison.OrdinalIgnoreCase) >= 0;
+            //    bool dark = radioButton.Name.IndexOf(ThemesDrawMode.Dark.ToString(), StringComparison.OrdinalIgnoreCase) >= 0;
+            //}
+
+            DrawModes draw = PDFViewer.GetDrawMode();
+            UInt32 color = 0;
+
+            if (LightDrawMode)
+            {
+                draw = DrawModes.Draw_Mode_Normal;
+                SetDrawMode(draw, color);
+            }
+            else if (SepiaDrawMode)
+            {
+                draw = DrawModes.Draw_Mode_Soft;
+                SetDrawMode(draw, color);
+            }
+            else if (ResedaDrawMode)
+            {
+                draw = DrawModes.Draw_Mode_Green;
+                SetDrawMode(draw, color);
+            }
+            else if (DarkDrawMode)
+            {
+                draw = DrawModes.Draw_Mode_Dark;
+                SetDrawMode(draw, color);
+            }
+            else
+            {
+                if (obj is RadioButton radioButton)
+                {
+                    StackPanel panel = radioButton.Content as StackPanel;
+                    Rectangle rec = (panel.Children[0] as Border).Child as Rectangle;
+                    OpenFileInfo file = SettingHelper.GetFileInfo(PDFViewer?.Document.FilePath);
+                    if (file != null)
+                    {
+                        file.LastFillBrushColor = ((SolidColorBrush)rec.Fill).Color;
+                    }
+                    var color1 = rec.Fill.ToString().Substring(1, 8);
+                    UInt32 c = Convert.ToUInt32(color1, 16);
+                    PDFViewer.SetDrawMode(DrawModes.Draw_Mode_Normal);
+                    PDFViewer.SetDrawMode(DrawModes.Draw_Mode_Custom, c);
+                    UpdateFileInfoList(DrawModes.Draw_Mode_Custom, c);
+                }
+            }
+        }
+
+        private void SetDrawMode(DrawModes drawMode, UInt32 color)
+        {
+            if (PDFViewer == null)
+            {
+                return;
+            }
+
+            if (PDFViewer.GetDrawMode() != drawMode)
+            {
+                PDFViewer.SetDrawMode(drawMode);
+                UpdateFileInfoList(drawMode, color);
+            }
+        }
+
+        /// <summary>
+        /// 更新文件信息
+        /// </summary>
+        /// <param name="modes"></param>
+        /// <param name="color"></param>
+        private void UpdateFileInfoList(DrawModes modes, UInt32 color)
+        {
+            OpenFileInfo file = SettingHelper.GetFileInfo(PDFViewer?.Document.FilePath);
+            if (file != null)
+            {
+                file.LastDrawMode = modes;
+                if (color != 0)
+                {
+                    file.LastFillColor = color;
+                }
+            }
+            SettingHelper.SetFileInfo(file);
+        }
+
+        /// <summary>
+        /// 设置选中主题颜色
+        /// </summary>
+        /// <param name="wrapPanel"></param>
+        private void InitBeforeShow(WrapPanel wrapPanel)
+        {
+            var mode = PDFViewer.GetDrawMode();
+            if (mode == DrawModes.Draw_Mode_Normal)
+            {
+                LightDrawMode = true;
+            }
+            else if (mode == DrawModes.Draw_Mode_Dark)
+            {
+                DarkDrawMode = true;
+            }
+            else if (mode == DrawModes.Draw_Mode_Green)
+            {
+                ResedaDrawMode = true;
+            }
+            else if (mode == DrawModes.Draw_Mode_Soft)
+            {
+                SepiaDrawMode = true;
+            }
+            else
+            {
+                OpenFileInfo info = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);
+                var color = info.LastFillBrushColor;
+                for (int i = 4; i < wrapPanel.Children.Count; i++)
+                {
+                    var btn = wrapPanel.Children[i] as RadioButton;
+                    if (btn != null && Color.Equals(((SolidColorBrush)(((btn.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill).Color, color))
+                    {
+                        btn.IsChecked = true;
+                    }
+                }
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            if (pdfview != null)
+            {
+                PDFViewer = pdfview;
+            }
+        }
+    }
+}

+ 370 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs

@@ -0,0 +1,370 @@
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Views;
+using PDFSettings.Settings;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Forms;
+
+namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
+{
+    public class ViewModularContentViewModel : BindableBase, INavigationAware
+    {
+        private IRegionManager region;
+
+        private IDialogService dialogs;
+
+        //记录 单页 双页  书本模式
+        private ViewMode viewmode = ViewMode.Single;
+
+        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;
+
+        /// <summary>
+        /// 控制Content的显示 用于显示分屏的模块
+        /// </summary>
+        public Visibility SplitScreenViewVisible
+        {
+            get { return splitScreenViewVisible; }
+            set
+            {
+                SetProperty(ref splitScreenViewVisible, value);
+            }
+        }
+
+        private bool isContinue;
+
+        public bool IsContinue
+        {
+            get { return isContinue; }
+            set
+            {
+                SetProperty(ref isContinue, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        private bool isPagesBreak = true;
+
+        public bool IsPagesBreak
+        {
+            get { return isPagesBreak; }
+            set
+            {
+                SetProperty(ref isPagesBreak, value);
+            }
+        }
+
+        private bool isSingleView;
+
+        public bool IsSingleView
+        {
+            get { return isSingleView; }
+            set
+            {
+                SetProperty(ref isSingleView, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        private bool isTwoPageView;
+
+        public bool IsTwoPageView
+        {
+            get { return isTwoPageView; }
+            set
+            {
+                SetProperty(ref isTwoPageView, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        private bool isBookModeView;
+
+        public bool IsBookModeView
+        {
+            get { return isBookModeView; }
+            set
+            {
+                SetProperty(ref isBookModeView, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        public DelegateCommand<object> VerticalSplitScreenCommand { get; set; }
+        public DelegateCommand<object> DisableCommand { get; set; }
+
+        public DelegateCommand SetViewModeCommand { get; set; }
+        public DelegateCommand<object> ContinueCommand { get; set; }
+        public DelegateCommand<object> PagesBreakCommand { get; set; }
+
+        public DelegateCommand<object> RotateCommand { get; set; }
+
+        public ViewModularContentViewModel(IRegionManager regionManager, IDialogService dialogService)
+        {
+            region = regionManager;
+            dialogs = dialogService;
+            //未显示时无法注册上Region名称,所以需要短暂显示
+            SplitScreenViewVisible = Visibility.Visible;
+            SplitScreenViewRegionName = RegionNames.SplitScreenViewRegionName;
+            ThemesContentName = RegionNames.ThemesContentName;
+            SplitScreenViewVisible = Visibility.Collapsed;
+
+            VerticalSplitScreenCommand = new DelegateCommand<object>(VerticalSplitScreenEvent);
+            DisableCommand = new DelegateCommand<object>(DisableEvent);
+            SetViewModeCommand = new DelegateCommand(SetModeView);
+            ContinueCommand = new DelegateCommand<object>(ContinueEvent);
+            PagesBreakCommand = new DelegateCommand<object>(PagesBreakEvent);
+            RotateCommand = new DelegateCommand<object>(RotateEvent);
+
+            //在构造函数中使用Region需要借助Dispatcher 确保UI已经加载完成,加载BOTA区域
+            System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+            {
+                NavigationParameters parameters = new NavigationParameters();
+                parameters.Add(ParameterNames.PDFViewer, PDFViewer);
+                region.RequestNavigate(RegionNames.ThemesContentName, "ThemesContent", parameters);
+            }
+            ));
+        }
+
+        /// <summary>
+        /// 旋转
+        /// </summary>
+        /// <param name="obj"></param>
+        private void RotateEvent(object obj)
+        {
+            bool right = Convert.ToBoolean(obj);
+
+            PDFViewer.RotatePage(PageRotate.Rotate90, right, PDFViewer.CurrentIndex);
+
+            //后续需要添加,缩略图旋转改变
+
+            PDFViewer.UndoManager.CanSave = true;
+        }
+
+        /// <summary>
+        /// 分页符
+        /// </summary>
+        /// <param name="obj"></param>
+        private void PagesBreakEvent(object obj)
+        {
+            if (IsPagesBreak)
+            {
+                PDFViewer.SetPageSpacing(8);
+                IsPagesBreak = true;
+            }
+            else
+            {
+                PDFViewer.SetPageSpacing(0);
+                IsPagesBreak = false;
+            }
+            SaveMode(IsPagesBreak);
+        }
+
+        /// <summary>
+        /// 设置显示模式
+        /// </summary>
+        private void SetModeView()
+        {
+            if (PDFViewer != null)
+            {
+                if (IsContinue)
+                {
+                    if (IsSingleView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.SingleContinuous);
+                    }
+                    else if (IsTwoPageView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.DoubleContinuous);
+                    }
+                    else
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.BookContinuous);
+                    }
+                }
+                else
+                {
+                    if (IsSingleView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.Single);
+                    }
+                    else if (IsTwoPageView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.Double);
+                    }
+                    else
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.Book);
+                    }
+                }
+            }
+            SaveMode(PDFViewer.ModeView);
+        }
+
+        /// <summary>
+        /// 连续滚动
+        /// </summary>
+        /// <param name="obj"></param>
+        private void ContinueEvent(object obj)
+        {
+            SetModeView();
+        }
+
+        /// <summary>
+        /// 保存模式到本地
+        /// </summary>
+        /// <param name="modeView"></param>
+        private void SaveMode(object modeView)
+        {
+            OpenFileInfo fileInfo = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);
+            if (fileInfo != null)
+            {
+                if (modeView is SplitMode)
+                {
+                    fileInfo.LastSplitMode = PDFViewer.Mode;
+                }
+                else if (modeView is ViewMode)
+                {
+                    fileInfo.LastViewMode = PDFViewer.ModeView;
+                }
+                else if (modeView is bool)
+                {
+                    fileInfo.LastPageSpace = (bool)modeView;
+                }
+                SettingHelper.SetFileInfo(fileInfo);
+            }
+        }
+
+        /// <summary>
+        /// 分屏视图-单屏
+        /// </summary>
+        /// <param name="obj"></param>
+        private void DisableEvent(object obj)
+        {
+            SplitScreenViewVisible = Visibility.Collapsed;
+        }
+
+        /// <summary>
+        /// 分屏视图-垂直
+        /// </summary>
+        /// <param name="obj"></param>
+        private void VerticalSplitScreenEvent(object obj)
+        {
+            SplitScreenViewVisible = Visibility.Visible;
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.PDFViewer, PDFViewer);
+            region.RequestNavigate(RegionNames.SplitScreenViewRegionName, "SplitScreenContent", param);
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            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;
+            IsContinue = BottomToolContentViewModel.IsContinue;
+            PDFViewer.InfoChanged += PDFViewer_InfoChanged;
+        }
+
+        /// <summary>
+        /// 和底部工具栏联动
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
+        {
+            if (e.Key == "ViewMode")
+            {
+                GetModeView((ViewMode)e.Value);
+            }
+        }
+
+        private void GetModeView(ViewMode mode)
+        {
+            if ((int)mode % 2 == 0)
+            {
+                if (!IsContinue)
+                {
+                    IsContinue = true;
+                }
+            }
+            else
+            {
+                if (IsContinue)
+                {
+                    IsContinue = false;
+                }
+            }
+
+            if ((int)mode <= 2)
+            {
+                if (!isSingleView)
+                {
+                    IsSingleView = true;
+                }
+            }
+            else if ((int)mode <= 4)
+            {
+                if (!isTwoPageView)
+                {
+                    IsTwoPageView = true;
+                }
+            }
+            else
+            {
+                if (!isBookModeView)
+                {
+                    IsBookModeView = true;
+                }
+            }
+        }
+    }
+}

+ 71 - 32
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>
@@ -189,7 +214,7 @@ namespace PDF_Office.ViewModels
             set
             {
                 SetProperty(ref botaWidth, value);
-                if(botaWidth.Value<=48)
+                if (botaWidth.Value <= 48)
                 {
                     OpenBOTA = false;
                 }
@@ -197,6 +222,7 @@ namespace PDF_Office.ViewModels
         }
 
         private int selectedIndex;
+
         /// <summary>
         /// 工具栏选中项的索引
         /// </summary>
@@ -209,24 +235,24 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
         private bool openBOTA = false;
+
         /// <summary>
         /// 是否展开BOTA
         /// </summary>
         public bool OpenBOTA
         {
             get { return openBOTA; }
-            set { 
-                openBOTA = value; 
-                if(openBOTA&&BOTAWidth.Value<=48)
+            set
+            {
+                openBOTA = value;
+                if (openBOTA && BOTAWidth.Value <= 48)
                 {
                     BOTAWidth = new GridLength(256);
                 }
             }
         }
 
-
         private Dictionary<string, string> regionNameByTabItem;
 
         private Dictionary<string, string> barContentByTabItem;
@@ -244,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; }
@@ -260,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)
         {
@@ -269,7 +300,7 @@ namespace PDF_Office.ViewModels
 
             LoadFile = new DelegateCommand(loadFile);
             Load = new DelegateCommand(LoadControl);
-            SaveFile = new DelegateCommand(()=> { saveFile(); });
+            SaveFile = new DelegateCommand(() => { saveFile(); });
             SaveAsFile = new DelegateCommand(() => { saveAsFile(); });
             UndoCommand = new DelegateCommand(Undo);
             RedoCommand = new DelegateCommand(Redo);
@@ -279,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;
@@ -293,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);
@@ -324,11 +361,11 @@ namespace PDF_Office.ViewModels
             {
                 CanSave = PDFViewer.UndoManager.CanSave;
             }
-            if(e.PropertyName == "CanUndo")
+            if (e.PropertyName == "CanUndo")
             {
                 CanUndo = PDFViewer.UndoManager.CanUndo;
             }
-            if(e.PropertyName =="CanRedo")
+            if (e.PropertyName == "CanRedo")
             {
                 CanRedo = PDFViewer.UndoManager.CanRedo;
             }
@@ -347,7 +384,7 @@ namespace PDF_Office.ViewModels
                 currentBar = item.Name;
                 if (previousBar != currentBar)
                 {
-                    if(currentBar== "TabItemPageEdit")//如果是页面编辑则进入页面编辑模式
+                    if (currentBar == "TabItemPageEdit")//如果是页面编辑则进入页面编辑模式
                     {
                         EnterToolMode(barContentByTabItem[currentBar]);
                         isInPageEdit = true;
@@ -363,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);
@@ -397,9 +435,11 @@ namespace PDF_Office.ViewModels
             }
             return standardZoom / 100;
         }
-        #endregion
+
+        #endregion PDFViewer鼠标滚轮缩放事件
 
         #region Navigate
+
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             if (isOpenFile)
@@ -417,7 +457,6 @@ namespace PDF_Office.ViewModels
                 loadFile();
             }
 
-
             isOpenFile = true;
         }
 
@@ -428,14 +467,15 @@ namespace PDF_Office.ViewModels
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
-
         }
-        #endregion
+
+        #endregion Navigate
 
         #region 方法
+
         private void Undo()
         {
-            if(isInPageEdit)
+            if (isInPageEdit)
             {
                 //执行页面编辑的Undo
                 PageEditUndo?.Invoke();
@@ -448,7 +488,7 @@ namespace PDF_Office.ViewModels
 
         private void Redo()
         {
-            if(isInPageEdit)
+            if (isInPageEdit)
             {
                 //执行页面编辑的Redo
                 PageEditRedo?.Invoke();
@@ -467,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(BOTARegionName, "BOTAContent", parameters);
                 region.RequestNavigate(BottomToolRegionName, "BottomToolContent", parameters);
+                region.RequestNavigate(ReadModeRegionName, "ReadModeContent", parameters);
 
                 //TODO 根据上一次关闭记录的菜单,选中TabItem
                 EnterSelectedBar("TabItemAnnotation");
@@ -486,7 +528,6 @@ namespace PDF_Office.ViewModels
                 region.RequestNavigate(PropertyRegionName, Content, parameters);
             }
          ));
-
         }
 
         /// <summary>
@@ -689,10 +730,10 @@ namespace PDF_Office.ViewModels
         /// 显示前添加内容到Region
         /// </summary>
         /// <param name="isPageEdit"></param>
-        private void ShowContent(string currentBar,bool isToolMode=false)
+        private void ShowContent(string currentBar, bool isToolMode = false)
         {
             //显示页面编辑或其他工具
-            if (currentBar == "TabItemPageEdit"||isToolMode)
+            if (currentBar == "TabItemPageEdit" || isToolMode)
             {
                 if (currentBar == "TabItemPageEdit")//进入页面编辑
                 {
@@ -735,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)
@@ -753,7 +794,7 @@ namespace PDF_Office.ViewModels
                 param = valuePairs;
             }
             region.RequestNavigate(ToolContentRegionName, targetToolMode, param);
-            ShowContent(currentBar,true);
+            ShowContent(currentBar, true);
 
             IsLoading = Visibility.Collapsed;
         }
@@ -773,15 +814,13 @@ namespace PDF_Office.ViewModels
         public void ExitToolMode()
         {
             ToolContentVisible = Visibility.Collapsed;
-            if(isInPageEdit)
+            if (isInPageEdit)
             {
                 TabSelectedIndex = 0;
                 isInPageEdit = false;
             }
         }
-        #endregion
-    }
-}
-
-
 
+        #endregion 方法
+    }
+}

+ 25 - 84
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -19,7 +19,7 @@
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="/Styles/ListViewStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/Styles/ListViewStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
 
             <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
@@ -41,7 +41,7 @@
                             Grid.Column="0"
                             Width="16"
                             Height="16"
-                            Source="\Resources\BOTA\empty_bookmark.png" />
+                            Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
                         <TextBox
                             Name="TxtTitleInput"
                             Grid.Column="1"
@@ -53,18 +53,9 @@
                             Text="{Binding Title}"
                             TextWrapping="Wrap">
                             <i:Interaction.Triggers>
-                                <!--<i:EventTrigger EventName="LostFocus">
-                                <helper:AdvancedInvokeCommandAction
-                                Command="{Binding DataContext.LostFocusCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
-                                CommandParameter="{Binding ElementName=TxtTitleInput}"
-                                PassEventArgsToCommand="True" />
-                                </i:EventTrigger>-->
-                                <!--<i:EventTrigger EventName="GotFocus">
-                                <helper:AdvancedInvokeCommandAction
-                                Command="{Binding DataContext.GotFocusCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
-                                CommandParameter="{Binding ElementName=TxtTitleInput}"
-                                PassEventArgsToCommand="True" />
-                                </i:EventTrigger>-->
+                                <i:EventTrigger EventName="KeyDown">
+                                    <i:InvokeCommandAction Command="{Binding DataContext.KeyDownCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
+                                </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </TextBox>
                         <TextBlock
@@ -76,56 +67,25 @@
                             Text="{Binding Title}"
                             Visibility="Visible" />
                     </Grid>
-                    <!--<i:Interaction.Triggers>
-                    <i:EventTrigger EventName="MouseEnter">
-                    -->
-                    <!--  绑定两个或多个参数  -->
-                    <!--<i:InvokeCommandAction Command="{Binding DataContext.MouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True">
-                    <i:InvokeCommandAction.CommandParameter>
-                    <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
-                    <MultiBinding.Bindings>
-                    <Binding ElementName="Grid" />
-                    <Binding ElementName="TxtTitleInput" />
-                    </MultiBinding.Bindings>
-                    </MultiBinding>
-                    </i:InvokeCommandAction.CommandParameter>
-                    </i:InvokeCommandAction>-->
-                    <!--  绑定两个参数  -->
-                    <!--
-                    <helper:AdvancedInvokeCommandAction
-                    Command="{Binding DataContext.MouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
-                    CommandParameter="{Binding ElementName=Grid}"
-                    PassEventArgsToCommand="True" />
-
-                    -->
-                    <!--  绑定多个参数  -->
-                    <!--<helper:AdvancedInvokeCommandAction Command="{Binding DataContext.MouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True">
-                    <helper:AdvancedInvokeCommandAction.CommandParameter>
-                    <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
-                    <MultiBinding.Bindings>
-                    <Binding ElementName="Grid" />
-                    <Binding ElementName="TextBlockTitle" />
-                    </MultiBinding.Bindings>
-                    </MultiBinding>
-                    </helper:AdvancedInvokeCommandAction.CommandParameter>
-                    </helper:AdvancedInvokeCommandAction>-->
-
-                    <!--  绑定一个参数  -->
-                    <!--<i:InvokeCommandAction Command="{Binding DataContext.MouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />-->
-                    <!--
-                    </i:EventTrigger>
-                    <i:EventTrigger EventName="MouseLeave">
-                    <helper:AdvancedInvokeCommandAction
-                    Command="{Binding DataContext.MouseLeaveCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
-                    CommandParameter="{Binding ElementName=Grid}"
-                    PassEventArgsToCommand="True" />
-                    -->
-                    <!--<i:InvokeCommandAction Command="{Binding DataContext.MouseLeaveCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />-->
-                    <!--
-                    </i:EventTrigger>
-                    </i:Interaction.Triggers>-->
                 </StackPanel>
             </DataTemplate>
+            <ContextMenu
+                x:Key="ContextMenu"
+                DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Self}}"
+                FontSize="14">
+                <MenuItem
+                    Click="MenuItemRename_Click"
+                    CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
+                    Header="重命名" />
+                <MenuItem
+                    Command="{Binding DataContext.EditPageIndexCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
+                    CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
+                    Header="更改目标位置" />
+                <MenuItem
+                    Click="MenuItemDeleteCommand_Click"
+                    CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
+                    Header="删除" />
+            </ContextMenu>
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid Background="#F2F2F2">
@@ -160,7 +120,7 @@
                 BorderThickness="0"
                 ItemTemplate="{StaticResource myDataTemplate}"
                 ItemsSource="{Binding Bookmarklist}"
-                PreviewMouseLeftButtonDown="BookMarkListView_PreviewMouseLeftButtonDown"
+                PreviewMouseDown="BookMarkListView_PreviewMouseDown"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 VirtualizingPanel.CacheLength="1"
                 VirtualizingPanel.CacheLengthUnit="Page"
@@ -176,28 +136,9 @@
                     <Style BasedOn="{StaticResource ListViewItemGraySelectStyle}" TargetType="ListViewItem">
                         <EventSetter Event="PreviewMouseDown" Handler="ListViewItem_MouseLeftButtonDown" />
                         <EventSetter Event="LostFocus" Handler="ListViewItem_LostFocus" />
-                        <!--<EventSetter Event="MouseLeave" Handler="ListViewItem_MouseLeave" />-->
-                        <!--<EventSetter Event="PreviewMouseMove" Handler="ListViewItem_PreviewMouseMove" />
-                        <EventSetter Event="MouseLeave" Handler="ListViewItem_MouseLeave" />-->
-                        <!--<EventSetter Event="Unselected" Handler="ListViewItem_Unselected" />-->
+                        <Setter Property="ContextMenu" Value="{StaticResource ContextMenu}" />
                     </Style>
                 </ListView.ItemContainerStyle>
-                <ListView.ContextMenu>
-                    <ContextMenu Width="200">
-                        <MenuItem
-                            Command="{Binding RenameCommand}"
-                            CommandParameter="{Binding PlacementTarget.SelectedItem, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
-                            Header="重命名" />
-                        <MenuItem
-                            Command="{Binding EditPageIndexCommand}"
-                            CommandParameter="{Binding PlacementTarget.SelectedItem, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
-                            Header="更改目标位置" />
-                        <MenuItem
-                            Command="{Binding DeleteCommand}"
-                            CommandParameter="{Binding PlacementTarget.SelectedItem, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
-                            Header="删除" />
-                    </ContextMenu>
-                </ListView.ContextMenu>
             </ListView>
         </Grid>
         <StackPanel
@@ -209,7 +150,7 @@
             <Image
                 Width="140"
                 Height="140"
-                Source="\Resources\BOTA\empty_bookmark.png" />
+                Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
             <TextBlock
                 Name="txtEmpty"
                 Margin="0,12,0,0"

+ 116 - 63
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -1,4 +1,5 @@
-using PDF_Office.Helper;
+using ComPDFKit.PDFDocument;
+using PDF_Office.Helper;
 using PDF_Office.ViewModels.BOTA;
 using System;
 using System.Collections.Generic;
@@ -23,6 +24,10 @@ namespace PDF_Office.Views.BOTA
     public partial class BookmarkContent : UserControl
     {
         private BookmarkContentViewModel viewModel = null;
+
+        /// <summary>
+        /// 上一个ListBoxItem,为选中状态做准备
+        /// </summary>
         private ListBoxItem histotyListBoxItem = null;
 
         public BookmarkContent()
@@ -31,18 +36,11 @@ namespace PDF_Office.Views.BOTA
             viewModel = this.DataContext as BookmarkContentViewModel;
         }
 
-        private void TxtTitleInput_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            if (sender is TextBox && IsLoaded)
-            {
-                TextBox textBox = sender as TextBox;
-                if (textBox.Visibility == Visibility.Visible)
-                {
-                    textBox.Focus();
-                }
-            }
-        }
-
+        /// <summary>
+        ///ListViewItem,鼠标左键点击
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void ListViewItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
             object[] objects = new object[] { sender, e };
@@ -59,33 +57,14 @@ namespace PDF_Office.Views.BOTA
 
                         if (textBlock != null)
                         {
-                            listBoxItem.IsSelected = true;
-                            listBoxItem.IsSelected = true;
-                            listBoxItem.Focus();
-                            textBlock.Visibility = Visibility.Collapsed;
                             TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
-                            textBox.Dispatcher.BeginInvoke(new Action(() =>
-                            {
-                                textBox.Focus();
-                                textBox.SelectAll();
-                            }));
 
-                            //textBox.PreviewMouseDown += new MouseButtonEventHandler(TxtTitleInput_PreviewMouseLeftButtonDown);
-                            //TxtTitleInput_PreviewMouseLeftButtonDown(textBox, mouse);
+                            SetSelectedStatus(listBoxItem, textBox, textBlock);
                         }
                     }
                 }
                 else if (e.ClickCount == 1)
                 {
-                    //var pos = e.GetPosition(histotyListBoxItem);
-                    //var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
-                    //if (result == null)
-                    //{
-                    //    histotyListBoxItem.IsSelected = false;
-                    //    textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-                    //    textBlock.Visibility = Visibility.Visible;
-                    //    textBlock.Focusable = true;
-                    //}
                     if (histotyListBoxItem != listBoxItem)
                     {
                         if (histotyListBoxItem != null)
@@ -100,13 +79,32 @@ namespace PDF_Office.Views.BOTA
                     viewModel.ListViewItemMouseDownCommand.Execute(sender);
                 }
             }
-            else if (e.RightButton == MouseButtonState.Pressed)
+        }
+
+        /// <summary>
+        /// ListViewItem双击时选中状态
+        /// </summary>
+        /// <param name="listBoxItem"></param>
+        /// <param name="textBox"></param>
+        /// <param name="textBlock"></param>
+        private void SetSelectedStatus(ListBoxItem listBoxItem, TextBox textBox, TextBlock textBlock)
+        {
+            listBoxItem.IsSelected = true;
+            listBoxItem.Focus();
+            textBlock.Visibility = Visibility.Collapsed;
+
+            textBox.Dispatcher.BeginInvoke(new Action(() =>
             {
-                listBoxItem.IsSelected = true;
-                listBoxItem.Focus();
-            }
+                textBox.Focus();
+                textBox.SelectAll();
+            }));
         }
 
+        /// <summary>
+        /// ListViewItem失去焦点
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void ListViewItem_LostFocus(object sender, RoutedEventArgs e)
         {
             ListBoxItem listItem = sender as ListBoxItem;
@@ -125,44 +123,99 @@ namespace PDF_Office.Views.BOTA
             }
         }
 
-        private void BookMarkListView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        /// <summary>
+        /// 右键菜单-重命名
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItemRename_Click(object sender, RoutedEventArgs e)
         {
-            var pos = e.GetPosition(BookMarkListView);
+            if (sender is MenuItem)
+            {
+                MenuItem menuItem = (MenuItem)sender;
+                CPDFBookmark bookmark = menuItem.CommandParameter as CPDFBookmark;
+                if (bookmark != null)
+                {
+                    ListBoxItem listBoxItem = (ListBoxItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(bookmark));
+                    histotyListBoxItem = listBoxItem;
 
-            var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
-            if (result != null)
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
+                    SetSelectedStatus(listBoxItem, textBox, textBlock);
+                }
+            }
+        }
+
+        /// <summary>
+        /// BookMarkListView,鼠标点击
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BookMarkListView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.LeftButton == MouseButtonState.Pressed)
             {
-                //获取当前鼠标指针下的容器
-                var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
-                if (listBoxItem == null)
+                var pos = e.GetPosition(BookMarkListView);
+
+                var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
+                if (result != null)
                 {
-                    if (BookMarkListView.SelectedItem != null)
-                    {
-                        ListBoxItem item = (ListBoxItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(BookMarkListView.SelectedItem));
-                        item.IsSelected = false;
-                        TextBlock box = CommonHelper.FindVisualChild<TextBlock>(item);
-                        box.Visibility = Visibility.Visible;
-                        BookMarkListView.SelectedItems.Clear();
-                    }
-                    if (histotyListBoxItem != null)
+                    //获取当前鼠标指针下的容器
+                    var listBoxItem = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
+                    if (listBoxItem == null)
                     {
-                        var pos1 = e.GetPosition(histotyListBoxItem);
-                        var result1 = VisualTreeHelper.HitTest(BookMarkListView, pos1);
-                        if (result1 == null)
+                        if (BookMarkListView.SelectedItem != null)
                         {
-                            histotyListBoxItem.IsSelected = false;
-                            TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-                            textBlock.Visibility = Visibility.Visible;
-                            textBlock.Focusable = true;
+                            ListBoxItem item = (ListBoxItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(BookMarkListView.SelectedItem));
+                            item.IsSelected = false;
+                            TextBlock box = CommonHelper.FindVisualChild<TextBlock>(item);
+                            box.Visibility = Visibility.Visible;
+                            BookMarkListView.SelectedItems.Clear();
+                        }
+                        if (histotyListBoxItem != null)
+                        {
+                            var pos1 = e.GetPosition(histotyListBoxItem);
+                            var result1 = VisualTreeHelper.HitTest(BookMarkListView, pos1);
+                            if (result1 == null)
+                            {
+                                histotyListBoxItem.IsSelected = false;
+                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                                textBlock.Visibility = Visibility.Visible;
+                                textBlock.Focusable = true;
+                            }
                         }
                     }
+                    else
+                    {
+                        listBoxItem.Focus();
+                    }
                 }
-                else
+                BookMarkListView.Focus();
+            }
+        }
+
+        /// <summary>
+        /// 右键菜单-删除
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItemDeleteCommand_Click(object sender, RoutedEventArgs e)
+        {
+            List<int> pagelist = new List<int>();
+            for (int i = 0; i < BookMarkListView.SelectedItems.Count; i++)
+            {
+                CPDFBookmark item = BookMarkListView.SelectedItems[i] as CPDFBookmark;
+                pagelist.Add(BookMarkListView.Items.IndexOf(item));
+            }
+            pagelist.Sort();
+            for (int i = 0; i < pagelist.Count; i++)
+            {
+                CPDFBookmark data = BookMarkListView.Items[pagelist[pagelist.Count - i - 1]] as CPDFBookmark;
+                if (data != null)
                 {
-                    listBoxItem.Focus();
+                    viewModel.DeleteCommand.Execute(data);
                 }
             }
-            BookMarkListView.Focus();
         }
     }
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 8 - 4
PDF Office/Views/BottomToolContent.xaml


+ 1 - 1
PDF Office/Views/Dialog/BOTA/AddBookmarkDialog.xaml

@@ -2,9 +2,9 @@
     x:Class="PDF_Office.Views.Dialog.BOTA.AddBookmarkDialog"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:dialogBOTA="clr-namespace:PDF_Office.ViewModels.Dialog.BOTA"
     xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:dialogBOTA="clr-namespace:PDF_Office.ViewModels.Dialog.BOTA"
     xmlns:local="clr-namespace:PDF_Office.Views.Dialog.BOTA"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"

+ 55 - 12
PDF Office/Views/Dialog/BOTA/BookmarkInfoDialog.xaml

@@ -1,12 +1,55 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.BOTA.BookmarkInfoDialog"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.BOTA"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
-</UserControl>
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.BOTA.BookmarkInfoDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:dialogBOTA="clr-namespace:PDF_Office.ViewModels.Dialog.BOTA"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.BOTA"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="395"
+    Height="220"
+    d:DataContext="{d:DesignInstance Type=dialogBOTA:BookmarkInfoDialogViewModel}"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <cus:DialogContent Header="提示">
+        <cus:DialogContent.Content>
+            <StackPanel Height="80" HorizontalAlignment="Center">
+                <TextBlock
+                    Name="TxtInput"
+                    Width="300"
+                    Margin="15"
+                    FontFamily="微软雅黑"
+                    FontSize="20"
+                    Text="{Binding BookmarkInfo}"
+                    TextWrapping="Wrap" />
+            </StackPanel>
+        </cus:DialogContent.Content>
+        <cus:DialogContent.BottmBar>
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="50*" />
+                    <ColumnDefinition Width="50*" />
+                </Grid.ColumnDefinitions>
+                <Button
+                    Grid.Column="0"
+                    Width="150"
+                    Height="32"
+                    Margin="25,0,0,0"
+                    HorizontalAlignment="Left"
+                    Command="{Binding OkCommnad}"
+                    Content="确定" />
+                <Button
+                    Grid.Column="1"
+                    Width="150"
+                    Height="32"
+                    Margin="0,0,25,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding CancelCommand}"
+                    Content="取消" />
+            </Grid>
+        </cus:DialogContent.BottmBar>
+    </cus:DialogContent>
+</UserControl>

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

@@ -0,0 +1,138 @@
+<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:convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:converter="clr-namespace:PDF_Office.DataConvert"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:helper="clr-namespace:PDF_Office.Helper"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.ViewModular"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    x:Name="ReadMode"
+    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>
+            <convert:ObjectConvert x:Key="ObjectConvert" />
+        </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"
+            Command="{Binding ZoomOutCommand}"
+            Interval="200"
+            Template="{StaticResource zoomout}" />
+        <RepeatButton
+            Name="btnZoomIn"
+            Width="32"
+            Height="32"
+            Margin="0,0,1,0"
+            Background="Transparent"
+            BorderThickness="0"
+            Command="{Binding ZoomInCommand}"
+            Interval="200"
+            Template="{StaticResource zoomin}" />
+
+        <Border
+            Width="100"
+            Height="32"
+            BorderBrush="White"
+            BorderThickness="0">
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition />
+                    <ColumnDefinition />
+                </Grid.ColumnDefinitions>
+                <Grid>
+                    <TextBox
+                        x:Name="TxtCurrentPageNum"
+                        Width="45"
+                        Height="32"
+                        Padding="0,5.5,0,0"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        CaretBrush="Black"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        Foreground="Black"
+                        InputMethod.IsInputMethodEnabled="False"
+                        LostFocus="TxtCurrentPageNum_LostFocus"
+                        LostKeyboardFocus="TxtCurrentPageNum_LostKeyboardFocus"
+                        Text="{Binding CurrentPage}"
+                        TextAlignment="Center">
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="KeyDown">
+                                <helper:AdvancedInvokeCommandAction
+                                    Command="{Binding KeyDownCommand}"
+                                    CommandParameter="{Binding ElementName=TxbCurrentPageNum}"
+                                    PassEventArgsToCommand="True" />
+                            </i:EventTrigger>
+                            <i:EventTrigger EventName="PreviewKeyDown">
+                                <i:InvokeCommandAction Command="{Binding PreviewKeyDownCommand}" PassEventArgsToCommand="True" />
+                            </i:EventTrigger>
+                            <!--<i:EventTrigger EventName="LostKeyboardFocus">
+                            <helper:AdvancedInvokeCommandAction
+                            Command="{Binding LostKeyboardFocusCommand}"
+                            CommandParameter="{Binding ElementName=TxbCurrentPageNum}"
+                            PassEventArgsToCommand="True" />
+                            </i:EventTrigger>-->
+                        </i:Interaction.Triggers>
+                    </TextBox>
+
+                    <TextBlock
+                        Name="TxbCurrentPageNum"
+                        Width="45"
+                        Height="32"
+                        Padding="0,5.5,0,0"
+                        Background="Transparent"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        Foreground="White"
+                        PreviewMouseLeftButtonDown="TxbCurrentPageNum_PreviewMouseLeftButtonDown"
+                        Text="{Binding CurrentPage}"
+                        TextAlignment="Center"
+                        Visibility="Visible" />
+                </Grid>
+
+                <TextBlock
+                    x:Name="TxtPageCount"
+                    Grid.Column="1"
+                    Height="32"
+                    MinWidth="50"
+                    Padding="0,5.5,0,0"
+                    FontFamily="Segoe UI"
+                    FontSize="14"
+                    Foreground="#999999"
+                    Text="{Binding PageCount, StringFormat=/    {0}}"
+                    TextAlignment="Left" />
+            </Grid>
+        </Border>
+        <Button
+            Name="btnPrePage"
+            Margin="25,0,2,0"
+            Background="Transparent"
+            Template="{StaticResource prepage}" Command="{Binding PrePageCommand}" />
+        <Button
+            x:Name="btnNextPage"
+            Margin="2,0,1,0"
+            Background="Transparent"
+            Template="{StaticResource nextpage}" Command="{Binding NextPageCommand}" />
+    </StackPanel>
+</UserControl>

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

@@ -0,0 +1,63 @@
+using DryIoc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+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();
+        }
+
+        private void TxbCurrentPageNum_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.ClickCount >= 2)
+            {
+                TxbCurrentPageNum.Visibility = Visibility.Collapsed;
+                TxtCurrentPageNum.Dispatcher.BeginInvoke(new Action(() =>
+                {
+                    TxtCurrentPageNum.Background = new SolidColorBrush(Colors.White);
+                    TxtCurrentPageNum.Focus();
+                    TxtCurrentPageNum.SelectAll();
+                }));
+            }
+        }
+
+        private void TxtCurrentPageNum_MouseLeave(object sender, RoutedEventArgs e)
+        {
+            TxbCurrentPageNum.Visibility = Visibility.Visible;
+
+            TxtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
+        }
+
+        private void TxtCurrentPageNum_LostFocus(object sender, RoutedEventArgs e)
+        {
+            TxbCurrentPageNum.Visibility = Visibility.Visible;
+            TxtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
+        }
+
+        private void TxtCurrentPageNum_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
+        {
+            TxbCurrentPageNum.Visibility = Visibility.Visible;
+            TxtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
+        }
+    }
+}

+ 21 - 0
PDF Office/Views/PropertyPanel/ViewModular/SplitScreenContent.xaml

@@ -0,0 +1,21 @@
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.ViewModular.SplitScreenContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:AnnotPanel="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:ViewModular="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
+    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="256"
+    d:DataContext="{d:DesignInstance Type=ViewModular:SplitScreenContentViewModel}"
+    d:DesignHeight="200"
+    d:DesignWidth="256"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <Grid>
+        <TextBlock FontSize="20" Text="分屏显示" />
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/PropertyPanel/ViewModular/SplitScreenContent.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>
+    /// SplitScreenContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class SplitScreenContent : UserControl
+    {
+        public SplitScreenContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 381 - 0
PDF Office/Views/PropertyPanel/ViewModular/ThemesContent.xaml

@@ -0,0 +1,381 @@
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.ViewModular.ThemesContent"
+    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:convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.ViewModular"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    Name="ThemesContentName"
+    d:DataContext="{d:DesignInstance Type=ViewModular:ThemesContentViewModel}"
+    d:DesignHeight="248"
+    d:DesignWidth="235"
+    Loaded="UserControl_Loaded"
+    mc:Ignorable="d">
+
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/Styles/RadioButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/Styles/TextBoxStyle.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+            <convert:ObjectConvert x:Key="ObjectConvert" />
+            <!--  虚线边框  -->
+            <DrawingBrush
+                x:Key="StaticborderBrush"
+                TileMode="Tile"
+                Viewport="0,0,8,8"
+                ViewportUnits="Absolute">
+                <DrawingBrush.Drawing>
+                    <DrawingGroup>
+                        <GeometryDrawing Brush="#FFA0A2AE">
+                            <GeometryDrawing.Geometry>
+                                <GeometryGroup>
+                                    <RectangleGeometry Rect="0,0,50,50" />
+                                    <RectangleGeometry Rect="50,50,50,50" />
+                                </GeometryGroup>
+                            </GeometryDrawing.Geometry>
+                        </GeometryDrawing>
+                    </DrawingGroup>
+                </DrawingBrush.Drawing>
+            </DrawingBrush>
+            <DrawingBrush
+                x:Key="OverborderBrush"
+                TileMode="Tile"
+                Viewport="0,0,8,8"
+                ViewportUnits="Absolute">
+                <DrawingBrush.Drawing>
+                    <DrawingGroup>
+                        <GeometryDrawing Brush="#477EDE">
+                            <GeometryDrawing.Geometry>
+                                <GeometryGroup>
+                                    <RectangleGeometry Rect="0,0,50,50" />
+                                    <RectangleGeometry Rect="50,50,50,50" />
+                                </GeometryGroup>
+                            </GeometryDrawing.Geometry>
+                        </GeometryDrawing>
+                    </DrawingGroup>
+                </DrawingBrush.Drawing>
+            </DrawingBrush>
+            <ContextMenu x:Key="radioButtonRightMenu">
+                <ContextMenu.ItemContainerStyle>
+                    <Style TargetType="MenuItem">
+                        <Setter Property="Padding" Value="-28,7,-80,7" />
+                        <Setter Property="VerticalContentAlignment" Value="Center" />
+                    </Style>
+                </ContextMenu.ItemContainerStyle>
+                <MenuItem Click="MenuItem_Click">
+                    <MenuItem.Header>
+                        <StackPanel Orientation="Horizontal">
+                            <Path Data="M11,1 L11,3 L14,3 L14,4 L13,4 L13,15 L3,15 L3,4 L2,4 L2,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M6,5 L6,13 L5,13 L5,5 L6,5 Z M8.5,5 L8.5,13 L7.5,13 L7.5,5 L8.5,5 Z M11,5 L11,13 L10,13 L10,5 L11,5 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z" Fill="{StaticResource MenuIco.fill}" />
+                            <TextBlock Margin="10,0,0,0" Text="删除" />
+                        </StackPanel>
+                    </MenuItem.Header>
+                </MenuItem>
+            </ContextMenu>
+            <Style
+                x:Key="CustomBtnStyle"
+                BasedOn="{StaticResource TitleBarBtn}"
+                TargetType="{x:Type Button}">
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="BorderBrush" Value="Transparent" />
+                <Setter Property="Width" Value="auto" />
+                <Setter Property="Height" Value="40" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type Button}">
+                            <Border
+                                x:Name="border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{StaticResource StaticborderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                SnapsToDevicePixels="true">
+                                <ContentPresenter
+                                    x:Name="contentPresenter"
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            </Border>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="border" Property="Background" Value="Transparent" />
+                                    <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource OverborderBrush}" />
+                                </Trigger>
+                                <Trigger Property="IsPressed" Value="true">
+                                    <Setter TargetName="border" Property="Background" Value="#C7D8F5" />
+                                    <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource OverborderBrush}" />
+                                </Trigger>
+                                <Trigger Property="IsEnabled" Value="false">
+                                    <Setter TargetName="border" Property="Background" Value="Transparent" />
+                                    <Setter TargetName="border" Property="BorderBrush" Value="#33000000" />
+                                    <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="#FF999999" />
+                                    <Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <WrapPanel Name="btnsPanel" Width="auto">
+        <RadioButton
+            Name="RBtnLight"
+            Margin="4,0,4,0"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnLight}"
+            GroupName="DrawMode"
+            IsChecked="{Binding LightDrawMode}"
+            Style="{StaticResource PageViewRadioBtn}">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="White" />
+                </Border>
+                <TextBlock
+                    x:Name="LightText"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Light" />
+            </StackPanel>
+        </RadioButton>
+        <RadioButton
+            Name="RBtnSepia"
+            Margin="4,0,4,0"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnSepia}"
+            GroupName="DrawMode"
+            IsChecked="{Binding SepiaDrawMode}"
+            Style="{StaticResource PageViewRadioBtn}">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="#FFEFB2" />
+                </Border>
+                <TextBlock
+                    x:Name="SepiaText"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Sepia" />
+            </StackPanel>
+        </RadioButton>
+        <RadioButton
+            Name="RBtnDark"
+            Margin="4,0,4,0"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnDark}"
+            GroupName="DrawMode"
+            IsChecked="{Binding DarkDrawMode}"
+            Style="{StaticResource PageViewRadioBtn}">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="Black" />
+                </Border>
+                <TextBlock
+                    x:Name="DarkText"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Dark" />
+            </StackPanel>
+        </RadioButton>
+
+        <RadioButton
+            Name="RBtnReseda"
+            Margin="4,4,4,0"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnReseda}"
+            GroupName="DrawMode"
+            IsChecked="{Binding ResedaDrawMode}"
+            Style="{StaticResource PageViewRadioBtn}">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="#CBE9CE" />
+                </Border>
+                <TextBlock
+                    x:Name="ResedaText"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Reseda" />
+            </StackPanel>
+        </RadioButton>
+        <RadioButton
+            Name="RBtnThemes1"
+            Margin="4,4,4,0"
+            GroupName="DrawMode"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnThemes1}"
+            ContextMenu="{StaticResource radioButtonRightMenu}"
+            IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
+            Style="{StaticResource PageViewRadioBtn}"
+            Visibility="Collapsed">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="#CBE9CE" />
+                </Border>
+                <TextBlock
+                    x:Name="Theme1Text"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Theme1" />
+            </StackPanel>
+        </RadioButton>
+        <RadioButton
+            Name="RBtnThemes2"
+            Margin="4,4,4,0"
+            GroupName="DrawMode"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnThemes2}"
+            ContextMenu="{StaticResource radioButtonRightMenu}"
+            IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
+            Style="{StaticResource PageViewRadioBtn}"
+            Visibility="Collapsed">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="#CBE9CE" />
+                </Border>
+                <TextBlock
+                    x:Name="Theme2Text"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Theme2" />
+            </StackPanel>
+        </RadioButton>
+        <RadioButton
+            Name="RBtnThemes3"
+            Margin="4,4,4,0"
+            GroupName="DrawMode"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnThemes3}"
+            ContextMenu="{StaticResource radioButtonRightMenu}"
+            IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
+            Style="{StaticResource PageViewRadioBtn}"
+            Visibility="Collapsed">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="#CBE9CE" />
+                </Border>
+                <TextBlock
+                    x:Name="Theme3Text"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Theme3" />
+            </StackPanel>
+        </RadioButton>
+        <RadioButton
+            Name="RBtnThemes4"
+            Margin="4,4,4,0"
+            GroupName="DrawMode"
+            Command="{Binding SetDrawModeCommand}"
+            CommandParameter="{Binding ElementName=RBtnThemes4}"
+            ContextMenu="{StaticResource radioButtonRightMenu}"
+            IsVisibleChanged="RBtnThemes1_IsVisibleChanged"
+            Style="{StaticResource PageViewRadioBtn}"
+            Visibility="Collapsed">
+            <StackPanel Margin="0,0,3,0">
+                <Border
+                    Width="16"
+                    Height="16"
+                    Margin="0,0,0,8"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="1">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Fill="#CBE9CE" />
+                </Border>
+                <TextBlock
+                    x:Name="Theme4Text"
+                    Style="{StaticResource PagesView_txtContext}"
+                    Text="Theme4" />
+            </StackPanel>
+        </RadioButton>
+        <Border
+            Width="72"
+            Height="80"
+            Margin="4,4,4,0">
+            <Button
+                Name="RBtnCustom"
+                Width="60"
+                Height="60"
+                BorderThickness="1"
+                Click="RBtnCustom_Click"
+                Style="{DynamicResource CustomBtnStyle}">
+                <StackPanel>
+                    <Path
+                        Margin="0,0,0,8"
+                        HorizontalAlignment="Center"
+                        Data="M8.5,2.5 L8.5,7.5 L13.5,7.5 L13.5,8.5 L8.5,8.5 L8.5,13.5 L7.5,13.5 L7.5,8.5 L2.5,8.5 L2.5,7.5 L7.5,7.5 L7.5,2.5 L8.5,2.5 Z"
+                        Fill="{StaticResource MenuIco.fill}" />
+                    <TextBlock
+                        x:Name="CustomText"
+                        Style="{StaticResource PagesView_txtContext}"
+                        Text="Custom" />
+                </StackPanel>
+            </Button>
+        </Border>
+    </WrapPanel>
+
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Loaded">
+            <prism:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=btnsPanel}" />
+        </i:EventTrigger>
+        <!--<i:EventTrigger EventName="MouseDown">
+        <prism:InvokeCommandAction Command="{Binding MouseDownCommand}" CommandParameter="{Binding}" />
+        </i:EventTrigger>-->
+    </i:Interaction.Triggers>
+</UserControl>

+ 264 - 0
PDF Office/Views/PropertyPanel/ViewModular/ThemesContent.xaml.cs

@@ -0,0 +1,264 @@
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Interop.PowerPoint;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Properties;
+using PDFSettings.Settings;
+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;
+using static PDF_Office.CustomControl.ColorDropBox;
+
+namespace PDF_Office.Views.PropertyPanel.ViewModular
+{
+    /// <summary>
+    /// ThemesContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class ThemesContent : UserControl
+    {
+        private ColorDropBoxPop colorPop = new ColorDropBoxPop();
+        private AdornerLayer popLayer;
+        private AdornerPresenter layerPresent;
+        private Canvas popCanvas;
+        public Color? SelectedColor { get; set; }
+
+        public ThemesContent()
+        {
+            InitializeComponent();
+            InitBeforeShow();
+        }
+
+        /// <summary>
+        /// 设置自定义主题显示状态
+        /// </summary>
+        public void InitBeforeShow()
+        {
+            if (Settings.Default.AppProperties.CustomColorList != null && Settings.Default.AppProperties.CustomColorList.Count > 0)
+            {
+                var list = Settings.Default.AppProperties.CustomColorList;
+                switch (list.Count)
+                {
+                    case 1:
+                        (((RBtnThemes1.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[0]);
+                        RBtnThemes1.Visibility = Visibility.Visible;
+                        break;
+
+                    case 2:
+                        (((RBtnThemes1.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[0]);
+                        (((RBtnThemes2.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[1]);
+                        RBtnThemes1.Visibility = Visibility.Visible;
+                        RBtnThemes2.Visibility = Visibility.Visible;
+                        break;
+
+                    case 3:
+                        (((RBtnThemes1.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[0]);
+                        (((RBtnThemes2.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[1]);
+                        (((RBtnThemes3.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[2]);
+                        RBtnThemes1.Visibility = Visibility.Visible;
+                        RBtnThemes2.Visibility = Visibility.Visible;
+                        RBtnThemes3.Visibility = Visibility.Visible;
+                        break;
+
+                    case 4:
+                        (((RBtnThemes1.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[0]);
+                        (((RBtnThemes2.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[1]);
+                        (((RBtnThemes3.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[2]);
+                        (((RBtnThemes4.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill = new SolidColorBrush(list[3]);
+                        RBtnThemes1.Visibility = Visibility.Visible;
+                        RBtnThemes2.Visibility = Visibility.Visible;
+                        RBtnThemes3.Visibility = Visibility.Visible;
+                        RBtnThemes4.Visibility = Visibility.Visible;
+                        break;
+                }
+            }
+        }
+
+        /// <summary>
+        /// 页面加载
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            if (popLayer == null)
+            {
+                Window parentWnd = Window.GetWindow(this);
+                if (parentWnd != null && parentWnd.Content is UIElement)
+                {
+                    popLayer = AdornerLayer.GetAdornerLayer(parentWnd.Content as UIElement);
+                    if (popLayer != null && colorPop != null)
+                    {
+                        layerPresent = new AdornerPresenter(popLayer);
+                        popLayer.Add(layerPresent);
+                        colorPop.Visibility = Visibility.Collapsed;
+                        colorPop.ColorSelected += ColorPop_ColorSelected;
+                        popCanvas = new Canvas();
+                        popCanvas.Children.Add(colorPop);
+                        layerPresent.VisualContent = popCanvas;
+                        parentWnd.AddHandler(MouseDownEvent, new MouseButtonEventHandler((eventsender, param) =>
+                        {
+                            colorPop.Visibility = Visibility.Collapsed;
+                        }), false);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// 自定义主题颜色,选择
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ColorPop_ColorSelected(object sender, Color e)
+        {
+            if (RBtnThemes1.Visibility == Visibility.Collapsed)
+            {
+                RBtnThemes1.Visibility = Visibility.Visible;
+                var panel = RBtnThemes1.Content as StackPanel;
+                var rec = (panel.Children[0] as Border).Child as Rectangle;
+                rec.Fill = new SolidColorBrush(e);
+                Settings.Default.AppProperties.CustomColorList.Add(e);
+            }
+            else if (RBtnThemes2.Visibility == Visibility.Collapsed)
+            {
+                RBtnThemes2.Visibility = Visibility.Visible;
+                var panel = RBtnThemes2.Content as StackPanel;
+                var rec = (panel.Children[0] as Border).Child as Rectangle;
+                rec.Fill = new SolidColorBrush(e);
+                Settings.Default.AppProperties.CustomColorList.Add(e);
+            }
+            else if (RBtnThemes3.Visibility == Visibility.Collapsed)
+            {
+                RBtnThemes3.Visibility = Visibility.Visible;
+                var panel = RBtnThemes3.Content as StackPanel;
+                var rec = (panel.Children[0] as Border).Child as Rectangle;
+                rec.Fill = new SolidColorBrush(e);
+                Settings.Default.AppProperties.CustomColorList.Add(e);
+            }
+            else if (RBtnThemes4.Visibility == Visibility.Collapsed)
+            {
+                RBtnThemes4.Visibility = Visibility.Visible;
+                var panel = RBtnThemes4.Content as StackPanel;
+                var rec = (panel.Children[0] as Border).Child as Rectangle;
+                rec.Fill = new SolidColorBrush(e);
+                Settings.Default.AppProperties.CustomColorList.Add(e);
+            }
+
+            #region to do
+
+            //if(Settings.Default.AppProperties.CustomColorList.Count>4)
+            //{
+            //    for(int i=4;i< Settings.Default.AppProperties.CustomColorList.Count;i++)
+            //    {
+            //        Settings.Default.AppProperties.CustomColorList.RemoveAt(i);
+            //    }
+            //}
+
+            #endregion to do
+
+            Settings.Default.Save();
+            if (SelectedColor != e)
+            {
+                SelectedColor = e;
+                colorPop.AddColorToRecent(e);
+            }
+        }
+
+        /// <summary>
+        /// 自定义颜色显示状态发生变化时
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void RBtnThemes1_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+        {
+            if (RBtnThemes1.Visibility == Visibility.Visible &&
+                RBtnThemes2.Visibility == Visibility.Visible &&
+                RBtnThemes3.Visibility == Visibility.Visible &&
+                RBtnThemes4.Visibility == Visibility.Visible)
+            {
+                RBtnCustom.Visibility = Visibility.Collapsed;
+            }
+            else
+            {
+                RBtnCustom.Visibility = Visibility.Visible;
+            }
+        }
+
+        /// <summary>
+        /// 添加自定义主题颜色
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void RBtnCustom_Click(object sender, RoutedEventArgs e)
+        {
+            if (colorPop != null)
+            {
+                if (colorPop.Visibility == Visibility.Visible)
+                {
+                    colorPop.Visibility = Visibility.Collapsed;
+                    return;
+                }
+                colorPop.Visibility = Visibility.Visible;
+                System.Windows.Point offset = GetOffsetToWindow();
+                Window parentWnd = Window.GetWindow(this);
+
+                colorPop.Measure(new Size(parentWnd.ActualWidth, parentWnd.ActualHeight));
+                colorPop.SetValue(Canvas.TopProperty, offset.Y - colorPop.DesiredSize.Height / 4);
+
+                if (offset.X + colorPop.DesiredSize.Width + SystemParameters.ResizeFrameVerticalBorderWidth * 2 > parentWnd.ActualWidth)
+                {
+                    colorPop.SetValue(Canvas.LeftProperty, parentWnd.ActualWidth - colorPop.DesiredSize.Width - 5 - SystemParameters.ResizeFrameVerticalBorderWidth * 2);
+                }
+                else
+                {
+                    colorPop.SetValue(Canvas.LeftProperty, offset.X - colorPop.DesiredSize.Width / 2 - 30);
+                }
+                colorPop.AddColorToRecent((Color)ColorConverter.ConvertFromString("White")); ;
+            }
+        }
+
+        public System.Windows.Point GetOffsetToWindow()
+        {
+            Window parentWnd = Window.GetWindow(this);
+            return TransformToAncestor(parentWnd).Transform(new System.Windows.Point(0, 0));
+        }
+
+        /// <summary>
+        /// 删除自定义颜色
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItem_Click(object sender, RoutedEventArgs e)
+        {
+            var contextmenu = (sender as MenuItem).Parent as ContextMenu;
+            if (contextmenu != null)
+            {
+                RadioButton btn = contextmenu.PlacementTarget as RadioButton;
+                btn.Visibility = Visibility.Collapsed;
+                if (btn.IsChecked == true)
+                {
+                    //如果删除了选中色 则更换主题为白色
+                    RBtnLight.IsChecked = true;
+                }
+                var color = (((btn.Content as StackPanel).Children[0] as Border).Child as Rectangle).Fill;
+                if (Settings.Default.AppProperties.CustomColorList.Contains(((SolidColorBrush)color).Color))
+                {
+                    Settings.Default.AppProperties.CustomColorList.Remove(((SolidColorBrush)color).Color);
+                    Settings.Default.Save();
+                }
+            }
+        }
+    }
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 343 - 0
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml


+ 52 - 0
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs

@@ -0,0 +1,52 @@
+using ComPDFKitViewer;
+using PDF_Office.ViewModels;
+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
+    {
+        public ViewModularContent()
+        {
+            InitializeComponent();
+        }
+
+        /// <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_Click(sender, e);
+
+                    }
+
+                }
+            }
+        }
+    }
+}

+ 51 - 10
PDF Office/Views/ViewContent.xaml

@@ -3,6 +3,7 @@
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:Viewer="clr-namespace:ComPDFKitViewer.PdfViewer;assembly=ComPDFKit.Viewer"
+    xmlns:convert="clr-namespace:PDF_Office.DataConvert"
     xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
@@ -14,6 +15,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,12 +24,18 @@
     </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" />
             </Style>
+            <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
         </ResourceDictionary>
     </UserControl.Resources>
+
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Name="HeadRow" Height="40" />
@@ -36,7 +44,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 +80,10 @@
             </Button>
         </StackPanel>
         <!--  右边菜单按钮  -->
-        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+        <StackPanel
+            HorizontalAlignment="Right"
+            Orientation="Horizontal"
+            Visibility="{Binding IsReadMode}">
             <Button
                 Margin="8"
                 Style="{StaticResource MenuButtonStyle}"
@@ -98,7 +112,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="注释"
@@ -154,10 +169,9 @@
             </i:Interaction.Triggers>
         </TabControl>
 
-
         <!--<ScrollViewer Name="PropScrollView" Grid.Row="2" SizeChanged="PropPanel_SizeChanged" VerticalScrollBarVisibility="Auto" Focusable="False">
-            <Grid x:Name="PropPanel">
-            </Grid>
+        <Grid x:Name="PropPanel">
+        </Grid>
         </ScrollViewer>-->
 
         <Grid Name="DocumentView" Grid.Row="2">
@@ -188,7 +202,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"
@@ -201,12 +215,39 @@
                 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}"
+                MouseLeave="ReadModeContent_MouseLeave"
+                Visibility="Collapsed" />
 
+            <Rectangle
+                x:Name="RectangleReadMode"
+                Grid.Column="0"
+                Grid.ColumnSpan="5"
+                Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
+                Height="44"
+                Margin="0,0,0,5"
+                HorizontalAlignment="Center"
+                VerticalAlignment="Bottom"
+                Fill="Transparent"
+                MouseEnter="RectangleReadMode_MouseEnter"
+                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
@@ -224,4 +265,4 @@
             prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
             Visibility="{Binding ToolsBarContentVisible}" />
     </Grid>
-</UserControl>
+</UserControl>

+ 99 - 3
PDF Office/Views/ViewContent.xaml.cs

@@ -1,4 +1,11 @@
-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;
+using System.Windows.Media;
 
 namespace PDF_Office.Views
 {
@@ -7,14 +14,103 @@ namespace PDF_Office.Views
     /// </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>
+        public void RbtnReadMode_Click(object sender, RoutedEventArgs e)
+        {
+            if (viewModel != null)
+            {
+                App.IsBookMode = true;
+                SetReadMode(true);
+            }
+        }
+
+        /// <summary>
+        /// 设置阅读模式下的控件
+        /// </summary>
+        /// <param name="isBookMode"></param>
+        private void SetReadMode(bool isBookMode)
+        {
+            if (isBookMode)
+            {
+                viewModel.IsReadMode = Visibility.Collapsed;
+                viewModel.IsPropertyOpen = false;
+                viewModel.ToolContentVisible = Visibility.Collapsed;
+                viewModel.ToolsBarContentVisible = Visibility.Collapsed;
+                this.ReadModeContent.Visibility = Visibility.Visible;
+                this.RectangleReadMode.Visibility = Visibility.Collapsed;
+                Grid.SetColumn(this.PDFViewerContent, 0);
+                Grid.SetColumnSpan(this.PDFViewerContent, 4);
+                Grid.SetRow(this.DocumentView, 0);
+                Grid.SetRowSpan(this.DocumentView, 4);
+            }
+            else
+            {
+                viewModel.IsReadMode = Visibility.Visible;
+                viewModel.IsPropertyOpen = true;
+                viewModel.ToolContentVisible = Visibility.Visible;
+                viewModel.ToolsBarContentVisible = Visibility.Visible;
+                this.ReadModeContent.Visibility = Visibility.Collapsed;
+                this.RectangleReadMode.Visibility = Visibility.Visible;
+                Grid.SetColumn(this.PDFViewerContent, 2);
+                Grid.SetColumnSpan(this.PDFViewerContent, 1);
+                Grid.SetRow(this.DocumentView, 2);
+                Grid.SetRowSpan(this.DocumentView, 1);
+            }
+        }
+
+        /// <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);
+                }
+            }
         }
 
-        private void PropPanel_SizeChanged(object sender, System.Windows.SizeChangedEventArgs e)
+        /// <summary>
+        /// 鼠标移开页面控件,三秒后隐藏该控件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private async void ReadModeContent_MouseLeave(object sender, RoutedEventArgs e)
         {
+            await System.Threading.Tasks.Task.Delay(3000);
+            this.ReadModeContent.Visibility = Visibility.Collapsed;
+            this.RectangleReadMode.Visibility = Visibility.Visible;
+        }
 
+        /// <summary>
+        /// 鼠标移动到控件范围时显示控件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void RectangleReadMode_MouseEnter(object sender, MouseEventArgs e)
+        {
+            if (App.IsBookMode)
+            {
+                this.ReadModeContent.Visibility = Visibility.Visible;
+                this.RectangleReadMode.Visibility = Visibility.Collapsed;
+            }
         }
     }
-}
+}