فهرست منبع

Merge branch 'dev' into practice2

# Conflicts:
#	PDF Office/Views/ViewContent.xaml
OYXH\oyxh 2 سال پیش
والد
کامیت
a63f2cc2d6
25فایلهای تغییر یافته به همراه860 افزوده شده و 133 حذف شده
  1. 5 0
      PDF Office/App.xaml.cs
  2. 53 0
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml
  3. 222 0
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs
  4. 15 24
      PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml.cs
  5. 0 11
      PDF Office/CustomControl/DialogContent.cs
  6. 17 1
      PDF Office/DataConvert/InvertBoolConvert.cs
  7. 39 0
      PDF Office/EventAggregators/SplitEvent.cs
  8. 9 0
      PDF Office/Model/DialogNames.cs
  9. 5 0
      PDF Office/Model/ParameterNames.cs
  10. 16 2
      PDF Office/PDF Office.csproj
  11. 2 1
      PDF Office/ViewModels/BottomToolContentViewModel.cs
  12. 32 0
      PDF Office/ViewModels/Dialog/Redaction/MarkSettingDialogViewModel.cs
  13. 32 0
      PDF Office/ViewModels/Dialog/Redaction/PageMarkDialogViewModel.cs
  14. 32 0
      PDF Office/ViewModels/Dialog/Redaction/RepeatMarkDialogViewModel.cs
  15. 51 2
      PDF Office/ViewModels/EditTools/Redaction/RedactionContentViewModel.cs
  16. 20 4
      PDF Office/ViewModels/Form/FormBaseVM.cs
  17. 6 1
      PDF Office/ViewModels/Form/FormsToolContentViewModel.cs
  18. 102 32
      PDF Office/ViewModels/Form/TextFieldPropertyViewModel.cs
  19. 37 1
      PDF Office/ViewModels/ViewContentViewModel.cs
  20. 20 1
      PDF Office/Views/Dialog/Redaction/PageMarkDialog.xaml
  21. 3 0
      PDF Office/Views/EditTools/Redaction/RedactionContent.xaml
  22. 10 32
      PDF Office/Views/Form/TextFieldProperty.xaml
  23. 46 2
      PDF Office/Views/Form/TextFieldProperty.xaml.cs
  24. 38 19
      PDF Office/Views/ViewContent.xaml
  25. 48 0
      PDF Office/Views/ViewContent.xaml.cs

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

@@ -52,6 +52,7 @@ using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomeP
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground;
 using ComDocumentAIKit;
+using PDF_Office.Views.Dialog.Redaction;
 
 namespace PDF_Office
 {
@@ -296,6 +297,10 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<AddBookmarkDialog>(DialogNames.AddBookmarkDialog);
             containerRegistry.RegisterDialog<EditPresetColorsDialog>(DialogNames.EditPresetColorsDialog);
             containerRegistry.RegisterDialog<CreateFromHtmlDialog>(DialogNames.CreateFromHtmlDialog);
+            //标记密文弹窗
+            containerRegistry.RegisterDialog<MarkSettingDialog>(DialogNames.MarkSettingDialog);
+            containerRegistry.RegisterDialog<PageMarkDialog>(DialogNames.PageMarkDialog);
+            containerRegistry.RegisterDialog<RepeatMarkDialog>(DialogNames.RepeatMarkDialog);
             #endregion 注册弹窗
         }
 

+ 53 - 0
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml

@@ -0,0 +1,53 @@
+<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.CustomComboControl"
+             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.CompositeControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800"
+             x:Name="usercontrol"
+             Loaded="UserControl_Loaded"
+             >
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Styles/SliderStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+
+            <DataTemplate x:Key="numberData">
+                <Grid>
+                    <TextBlock Text="{Binding Content}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                </Grid>
+            </DataTemplate>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+
+            <Border  BorderBrush="#E2E3E6"  HorizontalAlignment="Stretch" Height="32" Margin="0,0,11,0"  BorderThickness="0">
+                <Grid>
+                    <ComboBox Name="comBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6" 
+                                  MaxDropDownHeight="200"
+                            ItemTemplate="{StaticResource numberData}"
+                              >
+                        <ComboBox.ItemContainerStyle>
+                            <Style TargetType="{x:Type ComboBoxItem}">
+                                <Setter Property="Padding" Value="10 0 0 0"/>
+                            </Style>
+                        </ComboBox.ItemContainerStyle>
+                    </ComboBox>
+                    <TextBox Name="title" Background="White" FontFamily="Segoe UI" FontSize="14"  Height="20" Margin="10,0,35,0" IsReadOnly="True"
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
+                    </TextBox>
+                </Grid>
+            </Border>
+        </Grid>
+    </Grid>
+
+</UserControl>

+ 222 - 0
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs

@@ -0,0 +1,222 @@
+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.CustomControl.CompositeControl
+{
+    //用法:
+    // IsValueContent为ture时,使用ValueStr作为集合某项的值
+    //IsValueContent为false时,使用Value作为集合某项的值
+    //SetItemSource(List<ComboDataItem> items)更换集合List
+    //默认:字体集合、IsValueContent为false、Value作为集合某项的值
+
+
+    public class ComboDataItem
+    {
+        public string ValueStr { get; private set; }
+        public double Value { get; private set; }
+        public string Content { get; private set; }
+        public string Unit { get; private set; }
+        public ComboDataItem(double value, string unitStr = "")
+        {
+            Content = value + unitStr;
+            Value = value;
+        }
+        public ComboDataItem(string valueStr, string contentStr = "")
+        {
+            Content = contentStr;
+            ValueStr = valueStr;
+        }
+
+    }
+    /// <summary>
+    /// CustomComboControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class CustomComboControl : UserControl
+    {
+        public List<ComboDataItem> Items { get; private set; }
+        public event RoutedEventHandler ValueChanged;
+
+        public CustomComboControl()
+        {
+            InitializeComponent();
+            Items = new List<ComboDataItem>();
+            DefaultItems();
+        }
+        //更换集合
+        public void SetItemSource(List<ComboDataItem> items)
+        {
+            SelectedIndex = - 1;//为了触发SelectedIndex
+            Items = items;
+            comBox.ItemsSource = Items;
+            SelectedIndex = ((Items == null || Items.Count == 0) ? -1 : 0);
+        }
+
+        /// <summary>
+        /// 默认集合(字体集合)
+        /// </summary>
+        private void DefaultItems()
+        {
+            Items.Clear();
+            SelectedIndex = -1;
+
+            var item = new ComboDataItem(3);
+            Items.Add(item);
+            item = new ComboDataItem(6);
+            Items.Add(item);
+            item = new ComboDataItem(9);
+            Items.Add(item);
+            item = new ComboDataItem(12);
+            Items.Add(item);
+            item = new ComboDataItem(15);
+            Items.Add(item);
+            item = new ComboDataItem(18);
+            Items.Add(item);
+            item = new ComboDataItem(21);
+            Items.Add(item);
+            item = new ComboDataItem(24);
+            Items.Add(item);
+
+            comBox.ItemsSource = Items;
+            SelectedIndex = ((Items == null || Items.Count == 0) ? -1 : 0);
+        }
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            comBox.SelectionChanged -= comBox_SelectionChanged;
+            comBox.SelectionChanged += comBox_SelectionChanged;
+        }
+
+        private void comBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var item = comBox.SelectedItem as ComboDataItem;
+            if (item != null)
+            {
+                Value = item.Value;
+                ValueStr = item.ValueStr;
+                title.Text = item.Content;
+
+                if (IsValueContent == false)
+                    ValueChanged?.Invoke(Value, e);
+                else
+                    ValueChanged?.Invoke(ValueStr, e);
+            }
+
+
+        }
+
+        public double Value
+        {
+            get { return (double)GetValue(ValueProperty); }
+            set { SetValue(ValueProperty, value); }
+        }
+
+        public string ValueStr
+        {
+            get { return (string)GetValue(ValueStrProperty); }
+            set { SetValue(ValueStrProperty, value); }
+        }
+
+        public bool IsValueContent
+        {
+            get { return (bool)GetValue(IsValueContentProperty); }
+            set { SetValue(IsValueContentProperty, value); }
+        }
+
+        public List<ComboDataItem> ItemSource
+        {
+            get { return (List<ComboDataItem>)GetValue(ItemSourceProperty); }
+            set { SetValue(ItemSourceProperty, value); }
+        }
+
+        public int SelectedIndex
+        {
+            get { return (int)GetValue(SelectedIndexProperty); }
+            set { SetValue(SelectedIndexProperty, value); }
+        }
+
+        public static readonly DependencyProperty ValueProperty =
+           DependencyProperty.Register("Value", typeof(double), typeof(CustomComboControl), new PropertyMetadata(1.0, SelectedValuePropertyChanged));
+
+        public static readonly DependencyProperty ValueStrProperty =
+         DependencyProperty.Register("ValueStr", typeof(string), typeof(CustomComboControl), new PropertyMetadata("", SelectedValueStrPropertyChanged));
+
+        public static readonly DependencyProperty ItemSourceProperty =
+          DependencyProperty.Register("ItemSource", typeof(List<ComboDataItem>), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemSourcePropertyChanged));
+
+        public static readonly DependencyProperty SelectedIndexProperty =
+        DependencyProperty.Register("SelectedIndex", typeof(int), typeof(CustomComboControl), new PropertyMetadata(-1, SelectedIndexPropertyChanged));
+
+        public static readonly DependencyProperty IsValueContentProperty =
+          DependencyProperty.Register("IsValueContent", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false));
+
+        private static void SelectedValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var value = (double)e.NewValue;
+            if (control != null && control.IsValueContent == false)
+            {
+                control.ValueChanged?.Invoke(value, null);
+            }
+        }
+
+        private static void SelectedValueStrPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var value = (string)e.NewValue;
+            if (control != null && control.IsValueContent)
+            {
+                control.ValueChanged?.Invoke(value, null);
+            }
+        }
+       
+        private static void SelectedItemSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var value = (List<ComboDataItem>)e.NewValue;
+            if (control != null)
+            {
+                control.SelectedIndex = -1;
+                control.comBox.ItemsSource = value;
+                control.Items = value;
+                control.SelectedIndex = ((value == null || value.Count == 0) ? -1 : 0);
+            }
+        }
+
+        private static void SelectedIndexPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var value = (int)e.NewValue;
+            if (control != null)
+            {
+                if(control.comBox.Items != null && control.comBox.Items.Count > 0)
+                {
+                    control.comBox.SelectedIndex = value;
+                }
+                control.UpdateSelectedIndex();
+            }
+        }
+
+        public void UpdateSelectedIndex()
+        {
+            if(SelectedIndex < 0  || comBox.Items == null || comBox.Items.Count <= SelectedIndex)
+            {
+                title.Text = "";
+            }
+            else
+            {
+                title.Text = Items[SelectedIndex].Content;
+            }
+        }
+    }
+}

+ 15 - 24
PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml.cs

@@ -16,34 +16,24 @@ using System.Windows.Shapes;
 
 namespace PDF_Office.CustomControl.CompositeControl
 {
-   
-    public class ComboNumberItem
-    {
-        public double Value { get; set; }
-        public string Content { get; set; }
-        public string Unit { get; set; }
-        public ComboNumberItem(double value,string unitStr = "")
-        {
-            Content = value + unitStr;
-        }
-    }
+
     /// <summary>
     /// SlidComboControl.xaml 的交互逻辑
     /// </summary>
     public partial class SlidComboControl : UserControl
     {
-        public List<ComboNumberItem> Items { get;private set; }    
+        public List<ComboDataItem> Items { get;private set; }    
         public event RoutedEventHandler ValueChanged;
         
         public SlidComboControl()
         {
             InitializeComponent();
            
-            Items = new List<ComboNumberItem>();
+            Items = new List<ComboDataItem>();
             DefaultItems();
         }
 
-        public void SetItemSource(List<ComboNumberItem> items)
+        public void SetItemSource(List<ComboDataItem> items)
         {
             Items = items;
             ThicknessBox.ItemsSource = Items;
@@ -51,21 +41,21 @@ namespace PDF_Office.CustomControl.CompositeControl
 
         private void DefaultItems()
         {
-            var item = new ComboNumberItem(3);
+            var item = new ComboDataItem(3);
             Items.Add(item);
-            item = new ComboNumberItem(6);
+            item = new ComboDataItem(6);
             Items.Add(item);
-            item = new ComboNumberItem(9);
+            item = new ComboDataItem(9);
             Items.Add(item);
-            item = new ComboNumberItem(12);
+            item = new ComboDataItem(12);
             Items.Add(item);
-            item = new ComboNumberItem(15);
+            item = new ComboDataItem(15);
             Items.Add(item);
-            item = new ComboNumberItem(18);
+            item = new ComboDataItem(18);
             Items.Add(item);
-            item = new ComboNumberItem(21);
+            item = new ComboDataItem(21);
             Items.Add(item);
-            item = new ComboNumberItem(24);
+            item = new ComboDataItem(24);
             Items.Add(item);
 
             ThicknessBox.ItemsSource = Items;
@@ -84,7 +74,7 @@ namespace PDF_Office.CustomControl.CompositeControl
             foreach(var item in ThicknessBox.Items)
             {
 
-                var itemData = item as ComboNumberItem;
+                var itemData = item as ComboDataItem;
                 if(itemData != null)
                 {
                     if(itemData.Value == Value)
@@ -99,7 +89,7 @@ namespace PDF_Office.CustomControl.CompositeControl
 
         private void ThicknessBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            var item = ThicknessBox.SelectedItem as ComboNumberItem;
+            var item = ThicknessBox.SelectedItem as ComboDataItem;
             if(item != null)
             {
                 Value = item.Value;
@@ -127,5 +117,6 @@ namespace PDF_Office.CustomControl.CompositeControl
                 control.ValueChanged?.Invoke(value, null);
             }
         }
+
     }
 }

+ 0 - 11
PDF Office/CustomControl/DialogContent.cs

@@ -53,16 +53,5 @@ namespace PDF_Office.CustomControl
         public static readonly DependencyProperty BottmBarProperty =
             DependencyProperty.Register("BottmBar", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
 
-
-
-        public object Content
-        {
-            get { return (object)GetValue(ContentProperty); }
-            set { SetValue(ContentProperty, value); }
-        }
-
-        // Using a DependencyProperty as the backing store for Content.  This enables animation, styling, binding, etc...
-        public static readonly DependencyProperty ContentProperty =
-            DependencyProperty.Register("Content", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
     }
 }

+ 17 - 1
PDF Office/DataConvert/InvertBoolConvert.cs

@@ -32,7 +32,23 @@ namespace PDF_Office.DataConvert
 
         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
         {
-            throw new NotImplementedException();
+
+            if (value is bool)
+            {
+                if ((bool)value)
+                {
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            }
+            else
+            {
+                return false;
+            }
+
         }
     }
 }

+ 39 - 0
PDF Office/EventAggregators/SplitEvent.cs

@@ -0,0 +1,39 @@
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.EventAggregators
+{
+    public enum SplitMode
+    {
+        /// <summary>
+        /// 垂直分屏
+        /// </summary>
+        Vertical,
+        /// <summary>
+        /// 水平分屏
+        /// </summary>
+        Horizontal,
+        /// <summary>
+        /// 单屏(退出分屏)
+        /// </summary>
+        Single
+    }
+
+    public class SplitEventArgs
+    {
+        public SplitMode Mode { get; set; }
+
+        public string Unicode { get; set; }
+    }
+
+    /// <summary>
+    /// 通知分屏的事件
+    /// </summary>
+    public class SplitEvent: PubSubEvent<SplitEventArgs>
+    {
+    }
+}

+ 9 - 0
PDF Office/Model/DialogNames.cs

@@ -155,5 +155,14 @@ namespace PDF_Office.Model
         /// 从网页创建PDF弹窗
         /// </summary>
         public static string CreateFromHtmlDialog = "CreateFromHtmlDialog";
+
+        /// <summary>
+        /// 标记密文相关弹窗
+        /// </summary>
+        public static string MarkSettingDialog = "MarkSettingsDialog";
+
+        public static string PageMarkDialog = "PageMarkDialog";
+
+        public static string RepeatMarkDialog = "RepeatMarkDialog";
     }
 }

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

@@ -39,6 +39,11 @@ namespace PDF_Office.Model
 
         public static string BatchProcessing_Name = "BatchProcessing_Name";
 
+        /// <summary>
+        /// 页码集合
+        /// </summary>
+        public static string PageList = "PageList";
+
         /// <summary>
         /// 书签
         /// </summary>

+ 16 - 2
PDF Office/PDF Office.csproj

@@ -17,6 +17,7 @@
     <Deterministic>true</Deterministic>
     <NuGetPackageImportStamp>
     </NuGetPackageImportStamp>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
     <PublishUrl>publish\</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Disk</InstallFrom>
@@ -29,7 +30,6 @@
     <MapFileExtensions>true</MapFileExtensions>
     <ApplicationRevision>0</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
-    <IsWebBootstrapper>false</IsWebBootstrapper>
     <UseApplicationTrust>false</UseApplicationTrust>
     <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
@@ -44,16 +44,19 @@
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <DocumentationFile>
+    </DocumentationFile>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
+    <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="ComDocumentAIKit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
@@ -230,6 +233,9 @@
     <Compile Include="CustomControl\CompositeControl\ColorSubContent.xaml.cs">
       <DependentUpon>ColorSubContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\CompositeControl\CustomComboControl.xaml.cs">
+      <DependentUpon>CustomComboControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\CompositeControl\SlidComboControl.xaml.cs">
       <DependentUpon>SlidComboControl.xaml</DependentUpon>
     </Compile>
@@ -292,6 +298,7 @@
     <Compile Include="EventAggregators\PageEditNotifyEvent.cs" />
     <Compile Include="EventAggregators\PageEditRefreshEvent.cs" />
     <Compile Include="EventAggregators\SendPrintInfoEvent.cs" />
+    <Compile Include="EventAggregators\SplitEvent.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
@@ -384,6 +391,9 @@
       <AutoGen>True</AutoGen>
     </Compile>
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\Redaction\MarkSettingDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\Redaction\PageMarkDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\Redaction\RepeatMarkDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ToolsDialogs\MergeDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDocumentContentViewModel.cs" />
@@ -1032,6 +1042,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\CompositeControl\CustomComboControl.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="CustomControl\CompositeControl\SlidComboControl.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>

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

@@ -341,7 +341,8 @@ namespace PDF_Office.ViewModels
             if (PDFViewer != null)
             {
                 PDFViewer.GoToPage(PDFViewer.CurrentIndex + 1);
-                if (((int)PDFViewer.Mode % 2) == 0)
+                //双页模式 一次性跳两页
+                if (((int)PDFViewer.ModeView>2))
                 {
                     PDFViewer.GoToPage(PDFViewer.CurrentIndex + 2);
                 }

+ 32 - 0
PDF Office/ViewModels/Dialog/Redaction/MarkSettingDialogViewModel.cs

@@ -0,0 +1,32 @@
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.Redaction
+{
+    public class MarkSettingDialogViewModel : BindableBase, IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+           
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+           
+        }
+    }
+}

+ 32 - 0
PDF Office/ViewModels/Dialog/Redaction/PageMarkDialogViewModel.cs

@@ -0,0 +1,32 @@
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.Redaction
+{
+    public class PageMarkDialogViewModel : BindableBase, IDialogAware
+    {
+        public string Title =>"";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+   
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+    
+        }
+    }
+}

+ 32 - 0
PDF Office/ViewModels/Dialog/Redaction/RepeatMarkDialogViewModel.cs

@@ -0,0 +1,32 @@
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.Redaction
+{
+    public class RepeatMarkDialogViewModel : BindableBase, IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+           
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+           
+        }
+    }
+}

+ 51 - 2
PDF Office/ViewModels/EditTools/Redaction/RedactionContentViewModel.cs

@@ -1,11 +1,13 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
 using PDF_Office.EventAggregators;
 using PDF_Office.Model;
 using Prism.Commands;
 using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
+using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -20,8 +22,12 @@ namespace PDF_Office.ViewModels.EditTools.Redaction
 
         public IRegionManager redactionRegion;
 
+        public IDialogService dialogs;
+
         private CPDFViewer PDFViewer;
 
+        private ViewContentViewModel viewContentViewModel;
+
         public string RedactionDocumentRegionName { get; set; }
         public string RedactionBottomBarRegionName { get; set; }
 
@@ -31,16 +37,55 @@ namespace PDF_Office.ViewModels.EditTools.Redaction
 
         public DelegateCommand CloseEditToolCommand { get; set; }
 
-        public RedactionContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
+        public DelegateCommand ApplyCommmand { get; set; }
+
+        public DelegateCommand RemoveCommand { get; set; }
+
+        public DelegateCommand PageRedactionCommand { get; set; }
+
+        public RedactionContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator,IDialogService dialogService)
         {
             this.redactionRegion = regionManager;
             this.eventAggregator = eventAggregator;
+            this.dialogs = dialogService;
 
             RedactionDocumentRegionName = Guid.NewGuid().ToString();
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             CloseEditToolCommand = new DelegateCommand(CloseEditTool);
+            ApplyCommmand = new DelegateCommand(apply);
+            RemoveCommand = new DelegateCommand(remove);
+            PageRedactionCommand = new DelegateCommand(pageMark);
+        }
+
+        /// <summary>
+        /// 应用
+        /// </summary>
+        private void apply()
+        {
+            AlertsMessage alertsMessage = new AlertsMessage();
+            alertsMessage.ShowDialog("Apply Redactions", "Use blank blocks to remove selected sensitive content."+
+
+"This action will permanently delete the marked ciphertext information from this document and you will not be able to retrieve the marked ciphertext information.","Cancel","Apply & Save As");
+            if(alertsMessage.result== ContentResult.Ok)
+            {
+                viewContentViewModel.saveAsFile(true);
+            }
+        }
+
+        /// <summary>
+        /// 擦除
+        /// </summary>
+        private void remove()
+        {
+
         }
 
+        private void pageMark()
+        {
+            dialogs.ShowDialog(DialogNames.PageMarkDialog);
+        }
+
+
         public void CloseEditTool()
         {
             PDFViewer.SetMouseMode(MouseModes.Default);
@@ -49,6 +94,8 @@ namespace PDF_Office.ViewModels.EditTools.Redaction
             this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish(new EnumCloseModeUnicode { Unicode = this.Unicode, Status = EnumCloseMode.StatusCancel });
         }
 
+        #region Navigation
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -61,7 +108,8 @@ namespace PDF_Office.ViewModels.EditTools.Redaction
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
-            if(!redactionRegion.Regions[RedactionDocumentRegionName].Views.Contains(PDFViewer))
+            navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
+            if (!redactionRegion.Regions[RedactionDocumentRegionName].Views.Contains(PDFViewer))
             {
                 RedactionAnnotArgs redactionArgs = new RedactionAnnotArgs();
                 AnnotHandlerEventArgs annotArgs = null;
@@ -89,5 +137,6 @@ namespace PDF_Office.ViewModels.EditTools.Redaction
             }
   
         }
+        #endregion
     }
 }

+ 20 - 4
PDF Office/ViewModels/Form/FormBaseVM.cs

@@ -22,7 +22,8 @@ namespace PDF_Office.ViewModels.Form
         HeightSize,
         BorderColor,
         ContentColor,
-        FillColor
+        FillColor,
+        FontFamily
     }
     public class ResetColor : BindableBase
     {
@@ -107,11 +108,26 @@ namespace PDF_Office.ViewModels.Form
         }
 
         //是否为实线条
-        private ComPDFKit.PDFAnnotation.C_BORDER_STYLE _isSolid = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_SOLID;
-        public ComPDFKit.PDFAnnotation.C_BORDER_STYLE IsSolid
+        private bool _isSolid = true;
+        public bool IsSolid
         {
             get { return _isSolid; }
-            set { SetProperty(ref _isSolid, value); ChangeValueHandler?.Invoke(value, FormAttributeType.IsSolid); }
+            set { SetProperty(ref _isSolid, value);  }
+        }
+
+        //是否为实线条
+        private ComPDFKit.PDFAnnotation.C_BORDER_STYLE _borderStyle = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_SOLID;
+        public ComPDFKit.PDFAnnotation.C_BORDER_STYLE BorderStyle
+        {
+            get { return _borderStyle; }
+            set { 
+                SetProperty(ref _borderStyle, value);
+                if (value == ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_SOLID)
+                    IsSolid = true;
+                else
+                    IsSolid = false;
+
+                ChangeValueHandler?.Invoke(value, FormAttributeType.IsSolid); }
         }
 
         //宽大小

+ 6 - 1
PDF Office/ViewModels/Form/FormsToolContentViewModel.cs

@@ -125,7 +125,12 @@ namespace PDF_Office.ViewModels.Form
                 parameters.Add(ParameterNames.PDFViewer, PDFViewer);
                 parameters.Add("WidgetArgs", widget);
                 parameters.Add(ParameterNames.AnnotEvent, e);
-                regions.RequestNavigate(RegionNames.PropertyRegionName, btnToProperty[type], parameters);
+                System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+                {
+                    //if (toolregion.Regions.ContainsRegionWithName(MainContentRegionName))
+                    regions.RequestNavigate(RegionNames.PropertyRegionName, btnToProperty[type], parameters);
+                }));
+               
                 ShowPropertyPanel(true);
             }
         }

+ 102 - 32
PDF Office/ViewModels/Form/TextFieldPropertyViewModel.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.From;
@@ -127,6 +128,7 @@ namespace PDF_Office.ViewModels.Form
         private WidgetTextBoxArgs textBoxArgs;
         private bool IsCurrentWidget = false;
         private IDialogService dialogs;
+        public List<ComboDataItem> Items { get; private set; }
 
         #endregion
 
@@ -140,17 +142,24 @@ namespace PDF_Office.ViewModels.Form
 
         private void InitVariable()
         {
-            ResetColorOne = new ResetColor() { 
+            InitResetColor();
+            InitFontFamilyComboBox();
+        }
+
+        private void InitResetColor()
+        {
+            ResetColorOne = new ResetColor()
+            {
                 BorderColor = new SolidColorBrush(Colors.Transparent),
                 FontColor = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)),
-                FillColor = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00))
+                FillColor = new SolidColorBrush(Colors.Transparent)
             };
 
             ResetColorTwo = new ResetColor()
             {
                 BorderColor = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)),
                 FontColor = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00)),
-                FillColor = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x00, 0x00))
+                FillColor = new SolidColorBrush(Colors.Transparent)
             };
 
             ResetColorThree = new ResetColor()
@@ -166,6 +175,17 @@ namespace PDF_Office.ViewModels.Form
                 FontColor = new SolidColorBrush(Color.FromArgb(0xFF, 0xff, 0x00, 0x00)),
                 FillColor = new SolidColorBrush(Colors.Transparent)
             };
+
+        }
+        private void InitFontFamilyComboBox()
+        {
+            Items = new List<ComboDataItem>();
+            ComboDataItem item = new ComboDataItem("Courier", "Courier New");
+            Items.Add(item);
+            item = new ComboDataItem("Arial", "Helvetica");
+            Items.Add(item);
+            item = new ComboDataItem("Times New Roman", "Times New Roman");
+            Items.Add(item);
         }
 
         private void InitCommand()
@@ -193,20 +213,21 @@ namespace PDF_Office.ViewModels.Form
 
         private void LineStyleBtnEvent(object obj)
         {
-            if(obj != null)
+            if (obj != null)
             {
-                switch((string)obj)
+                switch ((string)obj)
                 {
                     case "Solid":
-                        IsSolid = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_SOLID;
+                        BorderStyle = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_SOLID;
                         break;
                     case "Dotted":
-                        IsSolid = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_DASHDED;
+                        BorderStyle = ComPDFKit.PDFAnnotation.C_BORDER_STYLE.BS_DASHDED;
                         break;
                 }
             }
         }
 
+
         private void IsScrollToDisplayChecked(object obj)
         {
            if(obj != null)
@@ -292,17 +313,17 @@ namespace PDF_Office.ViewModels.Form
 
         private void FontFamilyChanged(object obj)
         {
-           if(obj!= null)
+            if (obj != null && string.IsNullOrEmpty((string)obj) == false)
             {
-                switch((int)obj)
+                switch ((string)obj)
                 {
-                    case 0:
+                    case "Courier":
                         FontFamilyItem = new FontFamily("Courier");
                         break;
-                    case 1:
+                    case "Helvetica":
                         FontFamilyItem = new FontFamily("Helvetica");
                         break;
-                    case 2:
+                    case "Times Roman":
                         FontFamilyItem = new FontFamily("Times Roman");
                         break;
                 }
@@ -311,38 +332,78 @@ namespace PDF_Office.ViewModels.Form
 
         private void ResetColorCheckedBtn(object obj)
         {
-           if(obj != null)
+            if (obj != null)
             {
                 var str = obj as string;
-                if(str != null)
+                if (str != null)
                 {
-                    switch(str)
+                    switch (str)
                     {
                         case "One":
                             BorderColor = ResetColorOne.BorderColor.Color;
                             ContentColor = ResetColorOne.FontColor.Color;
-                            
+                            FillColor = ResetColorOne.FillColor.Color;
                             break;
 
                         case "Two":
                             BorderColor = ResetColorTwo.BorderColor.Color;
                             ContentColor = ResetColorTwo.FontColor.Color;
+                            FillColor = ResetColorTwo.FillColor.Color;
                             break;
 
                         case "Three":
                             BorderColor = ResetColorThree.BorderColor.Color;
                             ContentColor = ResetColorThree.FontColor.Color;
+                            FillColor = ResetColorThree.FillColor.Color;
                             break;
 
                         case "Forth":
                             BorderColor = ResetColorForth.BorderColor.Color;
                             ContentColor = ResetColorForth.FontColor.Color;
+                            FillColor = ResetColorForth.FillColor.Color;
                             break;
                     }
                 }
             }
         }
 
+        public event EventHandler<int> SelectResetColorBtnHandler;
+        private void UpdataSelectResetColorBtn()
+        {
+            int result = 0;
+            if (UpdataSelectResetColor(ResetColorOne))
+            {
+                result = 1;
+            }
+            else if (UpdataSelectResetColor(ResetColorTwo))
+            {
+                result = 2;
+            }
+            else if (UpdataSelectResetColor(ResetColorThree))
+            {
+                result = 3;
+            }
+            else if (UpdataSelectResetColor(ResetColorForth))
+            {
+                result = 4;
+            }
+
+            SelectResetColorBtnHandler?.Invoke(null, result);
+        }
+
+        private bool UpdataSelectResetColor(ResetColor reset)
+        {
+            if (reset.FillColor.Color == FillColor &&
+                reset.FontColor.Color == ContentColor &&
+                reset.BorderColor.Color == BorderColor
+                )
+            {
+                return true;
+            }
+
+            return false;
+        }
+
         private void ResetColorEvent(object obj)
         {
             //if(obj != null && (ResetColor)obj != null)
@@ -448,6 +509,7 @@ namespace PDF_Office.ViewModels.Form
             navigationContext.Parameters.TryGetValue<WidgetTextBoxArgs>("WidgetArgs", out textBoxArgs);
            
             GetWidgeText();
+            UpdataSelectResetColorBtn();
         }
         bool isCreateWidget = false;
         private void GetWidgeText()
@@ -458,10 +520,7 @@ namespace PDF_Office.ViewModels.Form
             {
                 PDFViewer.SetMouseMode(MouseModes.FormEditTool);
                 WidgetTextBoxArgs textArgs = new WidgetTextBoxArgs();
-                textArgs.BgColor = Colors.Transparent;
-                textArgs.FontSize = 12;
-                textArgs.FontFamily = "Courier New";
-                textArgs.FontColor = Colors.Black;
+                textArgs.BgColor = Colors.LightGray;
                 textArgs.FieldName = "TextBox";
                 textBoxArgs = textArgs;
                 PDFViewer.SetToolParam(textBoxArgs);
@@ -469,7 +528,6 @@ namespace PDF_Office.ViewModels.Form
             }
             else
             {
-  
                 PDFViewer.SetToolParam(new AnnotHandlerEventArgs());
                 isCreateWidget = false;
             }
@@ -479,23 +537,30 @@ namespace PDF_Office.ViewModels.Form
         }
         private void GetProperty()
         {
-            if(textBoxArgs != null)
+            if (textBoxArgs != null)
             {
                 NameStr = textBoxArgs.FieldName;
                 IsRequiredField = textBoxArgs.IsRequired;
                 IsMultiLine = textBoxArgs.IsMultiLine;
                 IsLocked = textBoxArgs.Locked;
                 ToolTipStr = textBoxArgs.Tooltip;
-
-
+                FillColor = textBoxArgs.BgColor;
+                ContentColor = textBoxArgs.FontColor;
+                BorderColor = textBoxArgs.LineColor;
+                BorderThiness = textBoxArgs.LineWidth;
+                BorderStyle = textBoxArgs.BorderStyle;
+                //避免BorderStyle跟上一个值相同,而没触发更改IsSolid属性
+                if (BorderStyle == C_BORDER_STYLE.BS_SOLID)
+                    IsSolid = true;
+                else
+                    IsSolid = false;
             }
         }
-
         //更改基类公共属性后,触发的事件
         private void ChangeValue(object sender, FormAttributeType e)
         {
 
-           switch(e)
+            switch (e)
             {
                 case FormAttributeType.Name:
                     textBoxArgs.FieldName = NameStr;
@@ -508,8 +573,8 @@ namespace PDF_Office.ViewModels.Form
                     break;
 
                 case FormAttributeType.IsSolid:
-                    textBoxArgs.BorderStyle = IsSolid;
-                    AttribEvent?.UpdateAttrib(AnnotAttrib.LineStyle, IsSolid);
+                    textBoxArgs.BorderStyle = BorderStyle;
+                    AttribEvent?.UpdateAttrib(AnnotAttrib.LineStyle, BorderStyle);
                     break;
 
                 case FormAttributeType.IsLocked:
@@ -519,7 +584,7 @@ namespace PDF_Office.ViewModels.Form
 
                 case FormAttributeType.HeightSize:
                     textBoxArgs.Height = HeightSize;
-                  //AttribEvent?.UpdateAttrib(AnnotAttrib.w, HeightSize);
+                    //AttribEvent?.UpdateAttrib(AnnotAttrib.w, HeightSize);
                     break;
 
                 case FormAttributeType.BorderThiness:
@@ -548,7 +613,7 @@ namespace PDF_Office.ViewModels.Form
 
                 case FormAttributeType.WidthSize:
                     textBoxArgs.Width = WidthSize;
-                    
+
                     break;
 
                 case FormAttributeType.IsRequiredField:
@@ -556,17 +621,22 @@ namespace PDF_Office.ViewModels.Form
                     AttribEvent?.UpdateAttrib(AnnotAttrib.IsRequired, IsRequiredField);
                     break;
 
+                case FormAttributeType.FontFamily:
+                    textBoxArgs.FontFamily = FontFamilyItem.Source;
+                    AttribEvent?.UpdateAttrib(AnnotAttrib.FontFamily, FontFamilyItem.Source);
+                    break;
+
             }
             AttribEvent?.UpdateAnnot();
         }
 
         private void ChangeFieldValue(string tag)
         {
-            switch(tag)
+            switch (tag)
             {
                 case "FormPos":
                     textBoxArgs.FormField = FormField.Visible;
-                    AttribEvent?.UpdateAttrib(AnnotAttrib.FormField,FormPos);
+                    AttribEvent?.UpdateAttrib(AnnotAttrib.FormField, FormPos);
                     break;
                 case "FontFamilyItem":
                     textBoxArgs.FontFamily = FontFamilyItem.Source;

+ 37 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -38,8 +38,15 @@ namespace PDF_Office.ViewModels
 
         public IDialogService dialogs;
 
+        public IEventAggregator events;
+
         public string ViwerRegionName { get; set; }
 
+        /// <summary>
+        /// 分屏视图的region名称
+        /// </summary>
+        public string SplitViewerRegionName { get; set; }
+
         public string BOTARegionName { get; set; }
 
         public string PropertyRegionName { get; set; }
@@ -424,6 +431,7 @@ namespace PDF_Office.ViewModels
         {
             region = regionManager;
             dialogs = dialogService;
+            events = eventAggregator;
             unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             LoadFile = new DelegateCommand(loadFile);
             Load = new DelegateCommand(LoadControl);
@@ -434,6 +442,7 @@ namespace PDF_Office.ViewModels
             TabControlSelectionChangedCommand = new DelegateCommand<object>(TabControlSelectonChangedEvent);
 
             ViwerRegionName = RegionNames.ViwerRegionName;
+            SplitViewerRegionName = RegionNames.SplitScreenViewRegionName;
             BOTARegionName = RegionNames.BOTARegionName;
             PropertyRegionName = RegionNames.PropertyRegionName;
             BottomToolRegionName = RegionNames.BottomToolRegionName;
@@ -666,6 +675,7 @@ namespace PDF_Office.ViewModels
             IsLoading = Visibility.Collapsed;
         }
 
+
         #region PDFViewer鼠标滚轮缩放事件
 
         public void PdfViewer_MouseWheelZoomHandler(object sender, bool e)
@@ -739,6 +749,21 @@ namespace PDF_Office.ViewModels
         #endregion Navigate
 
         #region 方法
+        /// <summary>
+        /// 视图面板  切换分屏模式
+        /// </summary>
+        /// <param name="mode"></param>
+        public void EnterSplitMode(SplitMode mode)
+        {
+            if(mode == SplitMode.Single)
+            {
+                //单屏时清空分屏区域内容
+                region.Regions[SplitViewerRegionName].RemoveAll();
+            }
+            ///通知UI层更改布局
+            this.events.GetEvent<SplitEvent>().Publish(new SplitEventArgs() { Unicode = unicode, Mode = mode });
+        }
+
 
         private void Undo()
         {
@@ -928,7 +953,7 @@ namespace PDF_Office.ViewModels
         /// <summary>
         /// 另存为或新文档保存逻辑
         /// </summary>
-        private bool saveAsFile()
+        public bool saveAsFile(bool isFromRedaction = false)
         {
             var dlg = new SaveFileDialog();
             dlg.Filter = Properties.Resources.OpenDialogFilter;
@@ -936,6 +961,17 @@ namespace PDF_Office.ViewModels
             if (dlg.ShowDialog() == true && !string.IsNullOrEmpty(dlg.FileName))
             {
                 bool result = false;
+                if(isFromRedaction)
+                {
+                    //应用标记密文并另存为保存
+                    try
+                    {
+                        PDFViewer.Document.ApplyRedaction();
+                        PDFViewer.Document.ReleasePages();
+                        PDFViewer.ReloadDocument();
+                    }
+                    catch { }
+                }
                 if (App.OpenedFileList.Contains(dlg.FileName))
                 {
                     //提示文件已经被打开

+ 20 - 1
PDF Office/Views/Dialog/Redaction/PageMarkDialog.xaml

@@ -58,6 +58,25 @@
                     Text="/" />
             </StackPanel>
         </StackPanel>
-
+        <cus:DialogContent.BottmBar>
+            <StackPanel VerticalAlignment="Center">
+                <StackPanel
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Orientation="Horizontal">
+                    <Button
+                        Width="80"
+                        Height="32"
+                        Content="Apply"
+                        Style="{StaticResource Btn.cta}" />
+                    <Button
+                        Width="80"
+                        Height="32"
+                        Margin="16,0,0,0"
+                        Content="Cancel"
+                        Style="{StaticResource btn.sec}" />
+                </StackPanel>
+            </StackPanel>
+        </cus:DialogContent.BottmBar>
     </cus:DialogContent>
 </UserControl>

+ 3 - 0
PDF Office/Views/EditTools/Redaction/RedactionContent.xaml

@@ -59,6 +59,7 @@
                     Height="28"
                     Margin="8,0"
                     Padding="4,0"
+                    Command="{Binding PageRedactionCommand}"
                     Style="{StaticResource subToolBar}">
                     <StackPanel Orientation="Horizontal">
                         <Path
@@ -79,12 +80,14 @@
                     Margin="8,0"
                     Padding="8,0"
                     Content="应用密文"
+                    Command="{Binding ApplyCommmand}"
                     Style="{StaticResource Btn.cta}" />
                 <Button
                     Height="24"
                     Margin="8,0"
                     Padding="8,0"
                     Content="擦除密文"
+                    Command="{Binding RemoveCommand}"
                     Style="{StaticResource Btn.cta}" />
                 <Button
                     Width="auto"

+ 10 - 32
PDF Office/Views/Form/TextFieldProperty.xaml

@@ -227,7 +227,7 @@
                     Click="BtnLineStyle_Click"
                     Command="{Binding LineStyleCommand}"
                     CommandParameter="{Binding ElementName=BtnSolidLine, Path=Tag}"
-                    Style="{StaticResource ToggleBtnViewModeStyle}"
+                    Style="{StaticResource ToggleBtnViewModeStyle}" IsChecked="{Binding IsSolid}"
                     Tag="Solid">
                                     <Border
                         Width="108"
@@ -251,7 +251,7 @@
                     Click="BtnLineStyle_Click"
                     Command="{Binding LineStyleCommand}"
                     CommandParameter="{Binding ElementName=BtnDottedLine, Path=Tag}"
-                    Style="{StaticResource ToggleBtnViewModeStyle}"
+                    Style="{StaticResource ToggleBtnViewModeStyle}" IsChecked="{Binding IsSolid,Converter={StaticResource InvertBoolConvert}}"
                     Tag="Dotted">
                                     <Border
                         Width="108"
@@ -291,36 +291,14 @@
                                     <RowDefinition Height="auto"></RowDefinition>
                                 </Grid.RowDefinitions>
 
-                                <Border BorderBrush="#E2E3E6" Grid.ColumnSpan="2"  Width="228" Height="32" Margin="12,0,4,0"  BorderThickness="0">
-                                    <Grid>
-                                        <ComboBox IsReadOnly="True" Name="FontFamilyBox" Background="Transparent" Padding="10 10 0 0"  BorderThickness="1" BorderBrush="#FFE2E3E6">
-                                            <ComboBox.ItemContainerStyle>
-                                                <Style TargetType="{x:Type ComboBoxItem}">
-                                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                                </Style>
-                                            </ComboBox.ItemContainerStyle>
-                                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                                <TextBlock Text="Courier New" FontFamily="Courier New" Tag="Courier"  FontSize="14"/>
-                                            </ComboBoxItem>
-                                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                                <TextBlock Text="Arial" FontFamily="Arial" Tag="Helvetica" FontSize="14"/>
-                                            </ComboBoxItem>
-                                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                                <TextBlock Text="Times New Roman" FontFamily="Times New Roman" Tag="Times Roman" FontSize="14"/>
-                                            </ComboBoxItem>
-                                            <i:Interaction.Triggers>
-                                                <i:EventTrigger EventName="SelectionChanged">
-                                                    <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=SelectedIndex}"/>
-                                                </i:EventTrigger>
-                                            </i:Interaction.Triggers>
-                                        </ComboBox>
-
-                                        <TextBox Name="FontFamilyText" FontFamily="Segoe UI" FontSize="14" Background="White"  Padding="10 0 0 0" Margin="2,0,25,0" IsReadOnly="True"
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
-                                        </TextBox>
-                                    </Grid>
-                                </Border>
-
+                                <CompositeControl:CustomComboControl x:Name="FontFamilyBox" ItemSource="{Binding Items}" IsValueContent="True" Grid.ColumnSpan="2"  Width="228" Height="32">
+                                    <i:Interaction.Triggers>
+                                        <i:EventTrigger EventName="ValueChanged">
+                                            <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=ValueStr}"/>
+                                        </i:EventTrigger>
+                                    </i:Interaction.Triggers>
+                                </CompositeControl:CustomComboControl>
+                              
   
                                 <Border Grid.Row="1" BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,8,4,0"  BorderThickness="0">
                                     <Grid>

+ 46 - 2
PDF Office/Views/Form/TextFieldProperty.xaml.cs

@@ -26,15 +26,59 @@ namespace PDF_Office.Views.Form
         public TextFieldProperty()
         {
             InitializeComponent();
+            this.Loaded += usercontrol_Loaded;
+            BindingEvent();
 
-           
+        }
+
+        private void usercontrol_Loaded(object sender, RoutedEventArgs e)
+        {
+            BindingEvent();
+        }
+
+        private void BindingEvent()
+        {
+            if (ViewModel != null)
+            {
+                ViewModel.SelectResetColorBtnHandler -= ViewModel_SelectResetColorBtnHandler;
+                ViewModel.SelectResetColorBtnHandler += ViewModel_SelectResetColorBtnHandler;
+            }
+        }
+
+        private void ViewModel_SelectResetColorBtnHandler(object sender, int e)
+        {
+            switch(e)
+            {
+                case 0:
+                    OneBtn.IsChecked = false;
+                    TwoBtn.IsChecked = false;
+                    ThreeBtn.IsChecked = false;
+                    ForthBtn.IsChecked = false;
+                    break;
+
+                case 1:
+                    OneBtn.IsChecked = true;
+                    break;
+
+                case 2:
+                    TwoBtn.IsChecked = true;
+                    break;
+
+                case 3:
+                    ThreeBtn.IsChecked = true;
+                    break;
+
+                case 4:
+                    ForthBtn.IsChecked = true;
+                    break;
+            }
         }
 
         private void EditMenuItem_Click(object sender, RoutedEventArgs e)
         {
             var Btnitem = sender as MenuItem;
             if (Btnitem == null) return;
-            if(ViewModel != null)
+            if (ViewModel != null)
             {
                 ViewModel.ResetColorCommand?.Execute(Btnitem);
             }

+ 38 - 19
PDF Office/Views/ViewContent.xaml

@@ -282,35 +282,54 @@
                 FocusVisualStyle="{x:Null}"
                 ResizeBehavior="PreviousAndNext"
                 ShowsPreview="True" />
-            <ContentControl
-                x:Name="PDFViewerContent"
-                Grid.Column="2"
-                HorizontalAlignment="Stretch"
-                prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
+            <Grid Name="GridViewer" Grid.Column="2">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="*" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Name="RowRight" Height="0" />
+                </Grid.RowDefinitions>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="*" />
+                    <ColumnDefinition Width="auto" />
+                    <ColumnDefinition Name="ColumnBottom" Width="0" />
+                </Grid.ColumnDefinitions>
+                <ContentControl
+                    x:Name="PDFViewerContent"
+                    HorizontalAlignment="Stretch"
+                    prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
+                <GridSplitter
+                    Name="VerticalSplitter"
+                    Grid.Row="1"
+                    Width="12" />
+                <GridSplitter
+                    Name="HorizontalSplitter"
+                    Grid.Column="1"
+                    Height="12" />
+                <ContentControl Name="SplitPDFViewer" prism:RegionManager.RegionName="{Binding SplitViewerRegionName}" />
+            </Grid>
+            <ScrollViewer
+                Name="Scroller"
+                Grid.Column="4"
+                Focusable="False"
+                VerticalScrollBarVisibility="Auto">
+                <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
+            </ScrollViewer>
             <Border
-                Name="LinkAnnotTipPanel"
+                Name="ViewContentTipPanel"
                 Grid.Column="2"
-                Width="{Binding ElementName=PDFViewerContent, Path=Width,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
-                Margin="0,0,18,0"
+                Width="{Binding ElementName=PDFViewerContent, Path=Width}"
+                HorizontalAlignment="Stretch"
                 VerticalAlignment="Top"
                 Background=" #BDDFFD"
-                Visibility="{Binding LinkAnnotTipVisibility}">
+                Visibility="Collapsed">
                 <TextBlock
                     x:Name="DrawTipsText"
-                    Margin="12"
+                    Margin="12,4"
                     Padding="4,2,4,2"
                     FontSize="14"
                     Foreground="#252629"
-                    Text="{Binding LinkAnnotTipText}" />
+                    Text="Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range" />
             </Border>
-
-            <ScrollViewer
-                Name="Scroller"
-                Grid.Column="4"
-                Focusable="False"
-                VerticalScrollBarVisibility="Auto">
-                <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
-            </ScrollViewer>
         </Grid>
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->

+ 48 - 0
PDF Office/Views/ViewContent.xaml.cs

@@ -1,8 +1,10 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.PdfViewer;
+using PDF_Office.EventAggregators;
 using PDF_Office.Model;
 using PDF_Office.ViewModels;
 using PDF_Office.Views.PropertyPanel.ViewModular;
+using Prism.Events;
 using Prism.Regions;
 using System;
 using System.Threading;
@@ -22,12 +24,58 @@ namespace PDF_Office.Views
     {
         private ViewContentViewModel viewModel = null;
 
+        private string unicode = "";
+
         public ViewContent()
         {
             InitializeComponent();
+            unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             viewModel = (ViewContentViewModel)this.DataContext;
         }
 
+        public ViewContent(IEventAggregator eventAggregator) :this()
+        {
+            eventAggregator.GetEvent<SplitEvent>().Subscribe(ChangeSplitModeUI, e => e.Unicode == unicode);
+        }
+
+
+        /// <summary>
+        /// 根据Vm事件通知处理分屏布局的事件
+        /// </summary>
+        /// <param name="e"></param>
+        private void ChangeSplitModeUI(SplitEventArgs e)
+        {
+            switch (e.Mode)
+            {
+                case EventAggregators.SplitMode.Vertical:
+                    //垂直分屏
+                    HorizontalSplitter.Visibility = Visibility.Collapsed;
+                    VerticalSplitter.Visibility = Visibility.Visible;
+                    RowRight.Height = new GridLength(0);
+                    ColumnBottom.Width = new GridLength(0,GridUnitType.Star);
+                    Grid.SetColumn(SplitPDFViewer,0);
+                    Grid.SetRow(SplitPDFViewer,2);
+                    break;
+                case EventAggregators.SplitMode.Horizontal:
+                    HorizontalSplitter.Visibility = Visibility.Visible;
+                    VerticalSplitter.Visibility = Visibility.Collapsed;
+                    RowRight.Height = new GridLength(0, GridUnitType.Star);
+                    ColumnBottom.Width = new GridLength(0);
+                    Grid.SetColumn(SplitPDFViewer, 2);
+                    Grid.SetRow(SplitPDFViewer, 0);
+                    break;
+                case EventAggregators.SplitMode.Single:
+                default:
+                    //退出分屏模式
+                    HorizontalSplitter.Visibility = Visibility.Collapsed;
+                    VerticalSplitter.Visibility = Visibility.Collapsed;
+                    RowRight.Height = new GridLength(0);
+                    ColumnBottom.Width = new GridLength(0);
+                    break;
+            }
+            GridViewer.UpdateLayout();
+        }
+
         /// <summary>
         /// 退出阅读模式
         /// </summary>