Ver código fonte

最近文件列表-调整最近文件列表逻辑

ZhouJieSheng 2 anos atrás
pai
commit
f4396a67ec

+ 31 - 24
PDF Office/Helper/PDFToolsHelper.cs

@@ -279,30 +279,36 @@ namespace PDF_Office.Helper
 
 
 
 
 
 
-            AllTools.Add(split.toolItem);
-            AllTools.Add(extract.toolItem);
-            AllTools.Add(insert.toolItem);
-            AllTools.Add(compress.toolItem);
-            AllTools.Add(merge.toolItem);
-            AllTools.Add(print.toolItem);
-            AllTools.Add(security.toolItem);
-            AllTools.Add(convertPDF.toolItem);
+            ///设置快捷工具默认初始顺序
             AllTools.Add(pDFToWord.toolItem);
             AllTools.Add(pDFToWord.toolItem);
             AllTools.Add(pDFToExcel.toolItem);
             AllTools.Add(pDFToExcel.toolItem);
             AllTools.Add(pDFToPPT.toolItem);
             AllTools.Add(pDFToPPT.toolItem);
-            AllTools.Add(imageToPDF.toolItem);
-            AllTools.Add(oCR.toolItem);
-            AllTools.Add(waterMark.toolItem);
-            AllTools.Add(headerFooter.toolItem);
-            AllTools.Add(batesNumbers.toolItem);
-            AllTools.Add(batch.toolItem);
-            AllTools.Add(background.toolItem);
-            AllTools.Add(compareDoc.toolItem);
-            AllTools.Add(redact.toolItem);
-            AllTools.Add(pageEdit.toolItem);
-            AllTools.Add(batchRemove.toolItem);
-            AllTools.Add(formFiledRecognition.toolItem);
             AllTools.Add(pDFToImage.toolItem);
             AllTools.Add(pDFToImage.toolItem);
+            AllTools.Add(security.toolItem);
+            AllTools.Add(imageToPDF.toolItem);
+            AllTools.Add(merge.toolItem);
+            AllTools.Add(compress.toolItem);
+
+            //更多工具默认初始顺序
+            //AllTools.Add(split.toolItem);
+            //AllTools.Add(extract.toolItem);
+            //AllTools.Add(insert.toolItem);
+            //AllTools.Add(merge.toolItem);
+            //AllTools.Add(print.toolItem);
+            //AllTools.Add(convertPDF.toolItem);
+            //AllTools.Add(imageToPDF.toolItem);
+            //AllTools.Add(oCR.toolItem);
+            //AllTools.Add(waterMark.toolItem);
+            //AllTools.Add(headerFooter.toolItem);
+            //AllTools.Add(batesNumbers.toolItem);
+            //AllTools.Add(batch.toolItem);
+            //AllTools.Add(background.toolItem);
+            //AllTools.Add(compareDoc.toolItem);
+            //AllTools.Add(redact.toolItem);
+            //AllTools.Add(pageEdit.toolItem);
+            //AllTools.Add(batchRemove.toolItem);
+            //AllTools.Add(formFiledRecognition.toolItem);
+            //AllTools.Add(pDFToImage.toolItem);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -344,11 +350,12 @@ namespace PDF_Office.Helper
         /// </summary>
         /// </summary>
         private void InitQuickTools()
         private void InitQuickTools()
         {
         {
+            //读取缓存的形式
+            //var cacheList = Settings.Default.AllPDFToolsList;
 
 
-            var cacheList = Settings.Default.AllPDFToolsList;
-
-            if (cacheList == null)
-                cacheList = new AllPDFToolsList();
+            //if (cacheList == null)
+            //暂时不用支持记录到缓存,且原方案有一定bug,先采用简单的形式加载处理
+            var  cacheList = new AllPDFToolsList();
 
 
             if(cacheList.Count > 0)
             if(cacheList.Count > 0)
             {
             {

+ 6 - 0
PDF Office/Helper/SettingHelper.cs

@@ -54,6 +54,12 @@ namespace PDF_Office.Helper
                 fileInfo.LastOpenTime = DateTime.Now;
                 fileInfo.LastOpenTime = DateTime.Now;
                 PDF_Office.Properties.Settings.Default.RecentOpenFiles.Insert(0, fileInfo);
                 PDF_Office.Properties.Settings.Default.RecentOpenFiles.Insert(0, fileInfo);
             }
             }
+
+            //限制最近文件列表显示的最大条数
+            if(Settings.Default.RecentOpenFiles.Count>Settings.Default.AppProperties.Description.FileCountInRecentFiles)
+            {
+                Settings.Default.RecentOpenFiles.RemoveRange(Settings.Default.AppProperties.Description.FileCountInRecentFiles, Settings.Default.RecentOpenFiles.Count-Settings.Default.AppProperties.Description.FileCountInRecentFiles);
+            }
             Settings.Default.Save();
             Settings.Default.Save();
         }
         }
 
 

+ 261 - 0
PDF Office/Helper/Win32Helper.cs

@@ -0,0 +1,261 @@
+using Microsoft.Win32;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Security.Principal;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Helper
+{
+    /// <summary>
+    /// 设置成默认阅读器的辅助类
+    /// </summary>
+    public static class Win32Helper
+    {
+        [StructLayout(LayoutKind.Sequential)]
+        public struct SECURITY_ATTRIBUTES
+        {
+            public int nLength;
+            public IntPtr lpSecurityDescriptor;
+            public int bInheritHandle;
+        }
+        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+        public struct STARTUPINFO
+        {
+            public Int32 cb;
+            public string lpReserved;
+            public string lpDesktop;
+            public string lpTitle;
+            public Int32 dwX;
+            public Int32 dwY;
+            public Int32 dwXSize;
+            public Int32 dwYSize;
+            public Int32 dwXCountChars;
+            public Int32 dwYCountChars;
+            public Int32 dwFillAttribute;
+            public Int32 dwFlags;
+            public Int16 wShowWindow;
+            public Int16 cbReserved2;
+            public IntPtr lpReserved2;
+            public IntPtr hStdInput;
+            public IntPtr hStdOutput;
+            public IntPtr hStdError;
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        public struct PROCESS_INFORMATION
+        {
+            public IntPtr hProcess;
+            public IntPtr hThread;
+            public int dwProcessId;
+            public int dwThreadId;
+        }
+
+        [Flags]
+        public enum HChangeNotifyEventID
+        {
+
+            SHCNE_ALLEVENTS = 0x7FFFFFFF,
+            SHCNE_ASSOCCHANGED = 0x08000000,
+            SHCNE_ATTRIBUTES = 0x00000800,
+            SHCNE_CREATE = 0x00000002,
+            SHCNE_DELETE = 0x00000004,
+            SHCNE_DRIVEADD = 0x00000100,
+            SHCNE_DRIVEADDGUI = 0x00010000,
+            SHCNE_DRIVEREMOVED = 0x00000080,
+            SHCNE_EXTENDED_EVENT = 0x04000000,
+            SHCNE_FREESPACE = 0x00040000,
+            SHCNE_MEDIAINSERTED = 0x00000020,
+            SHCNE_MEDIAREMOVED = 0x00000040,
+            SHCNE_MKDIR = 0x00000008,
+            SHCNE_NETSHARE = 0x00000200,
+            SHCNE_NETUNSHARE = 0x00000400,
+            SHCNE_RENAMEFOLDER = 0x00020000,
+            SHCNE_RENAMEITEM = 0x00000001,
+            SHCNE_RMDIR = 0x00000010,
+            SHCNE_SERVERDISCONNECT = 0x00004000,
+            SHCNE_UPDATEDIR = 0x00001000,
+            SHCNE_UPDATEIMAGE = 0x00008000,
+        }
+        [Flags]
+        public enum HChangeNotifyFlags
+        {
+            SHCNF_DWORD = 0x0003,
+            SHCNF_IDLIST = 0x0000,
+            SHCNF_PATHA = 0x0001,
+            SHCNF_PATHW = 0x0005,
+            SHCNF_PRINTERA = 0x0002,
+            SHCNF_PRINTERW = 0x0006,
+            SHCNF_FLUSH = 0x1000,
+            SHCNF_FLUSHNOWAIT = 0x2000
+        }
+
+        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
+        public static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes,
+    bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
+        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
+        public static extern uint GetModuleFileName([In] IntPtr hModule, [Out] StringBuilder lpFilename, [In][MarshalAs(UnmanagedType.U4)] int nSize);
+        [DllImport("kernel32.dll")]
+        public static extern void ExitProcess(uint uExitCode);
+        [DllImport("shell32.dll")]
+        static extern void SHChangeNotify(HChangeNotifyEventID wEventId, HChangeNotifyFlags uFlags, IntPtr dwItem1, IntPtr dwItem2);
+
+        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
+        public static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
+
+        /// <summary>
+        /// 注册为默认PDF浏览器
+        /// </summary>
+        /// <param name="isDefault"></param>
+        /// <returns></returns>
+        public static bool RegisterDefaultApp(bool isDefault)
+        {
+            bool isWin8OrHigher = false;
+            if (Environment.OSVersion.Version.Major > 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor > 1))
+            {
+                isWin8OrHigher = true;
+            }
+            try
+            {
+                AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName();
+                /*********** register APP Path  *******************/
+                RegistryKey appPathKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths", true);
+                if (appPathKey == null)
+                {
+                    return false;
+                }
+                RegistryKey appKey = appPathKey.CreateSubKey(assemblyName.Name + ".exe");
+                if (appKey != null)
+                {
+                    appKey.SetValue("", Assembly.GetExecutingAssembly().Location);
+                    appKey.SetValue("Path", Directory.GetParent(assemblyName.FullName).FullName);
+                    appKey.Close();
+                }
+                appPathKey.Close();
+                /*********** register ProgID  *******************/
+                RegistryKey progIdKey = Registry.ClassesRoot.CreateSubKey(assemblyName.Name + ".pdf.1");
+                if (progIdKey == null)
+                {
+                    return false;
+                }
+                progIdKey.SetValue("", assemblyName.Name);
+                RegistryKey openKey = progIdKey.CreateSubKey("Shell\\Open\\Command");
+                openKey.SetValue("", Assembly.GetExecutingAssembly().Location + " \"%s\"  \"%1\"");
+                openKey.Close();
+                progIdKey.Close();
+                /*********** register Default File Association  *******************/
+                RegistryKey softwareKey = Registry.LocalMachine.CreateSubKey("Software\\" + assemblyName.Name);
+                if (softwareKey == null)
+                {
+                    return false;
+                }
+                RegistryKey capabKey = softwareKey.CreateSubKey("Capabilities\\FileAssociations");
+                capabKey.SetValue(".pdf", assemblyName.Name + ".pdf.1");
+                capabKey.Close();
+                capabKey = softwareKey.CreateSubKey("Capabilities", true);
+                capabKey.SetValue("ApplicationDescription", assemblyName.Name);
+                capabKey.Close();
+                softwareKey.Close();
+                /*********** register Default App List  *******************/
+                RegistryKey regiserAppKeys = Registry.LocalMachine.OpenSubKey("SOFTWARE\\RegisteredApplications", true);
+                if (regiserAppKeys == null)
+                {
+                    return false;
+                }
+                regiserAppKeys.SetValue(assemblyName.Name, "SOFTWARE\\" + assemblyName.Name + "\\Capabilities");
+                regiserAppKeys.Close();
+                Registry.ClassesRoot.SetValue(".pdf", assemblyName.Name + ".pdf.1");
+                if (isDefault)
+                {
+                    if (isWin8OrHigher)
+                    {
+                        PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION();
+                        STARTUPINFO sInfo = new STARTUPINFO();
+                        SECURITY_ATTRIBUTES pSec = new SECURITY_ATTRIBUTES();
+                        SECURITY_ATTRIBUTES tSec = new SECURITY_ATTRIBUTES();
+                        pSec.nLength = Marshal.SizeOf(pSec);
+                        tSec.nLength = Marshal.SizeOf(tSec);
+                        string commandLine = " \".pdf\" \"" + assemblyName.Name + ".pdf.1\"";
+                        CreateProcess("Resources\\exe\\SFTA.exe", commandLine, ref pSec, ref tSec, false, 0, IntPtr.Zero, null, ref sInfo, out pInfo);
+                        WaitForSingleObject(pInfo.hProcess, 3000);
+                    }
+                    else
+                    {
+                        RegistryKey defaultKey = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice", true);
+                        defaultKey.SetValue("ProgId", assemblyName.Name + ".pdf.1");
+                        defaultKey.Close();
+                        SHChangeNotify(HChangeNotifyEventID.SHCNE_ASSOCCHANGED, HChangeNotifyFlags.SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
+                    }
+                }
+                else
+                {
+                    RegistryKey defaultKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf", true);
+                    RegistryKey userChoice = defaultKey.OpenSubKey("UserChoice");
+                    string checkId = userChoice.GetValue("ProgId").ToString();
+                    if (checkId == (assemblyName.Name + ".pdf.1") || checkId == "PDF Technologies, Inc..PDF Reader Pro")
+                    {
+                        defaultKey.DeleteSubKey("UserChoice");
+                        SHChangeNotify(HChangeNotifyEventID.SHCNE_ASSOCCHANGED, HChangeNotifyFlags.SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
+                    }
+                    defaultKey.Close();
+                }
+                return true;
+
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 判断是否是默认pdf阅读器
+        /// </summary>
+        /// <returns></returns>
+        public static bool IsDefaultApp()
+        {
+            try
+            {
+                AssemblyName assemblyName = Assembly.GetExecutingAssembly().GetName();
+                var asm = Assembly.GetExecutingAssembly();
+                RegistryKey defaultKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice");
+                AssemblyCompanyAttribute asmcpn = (AssemblyCompanyAttribute)Attribute.GetCustomAttribute(asm, typeof(AssemblyCompanyAttribute));
+                AssemblyProductAttribute aspro = (AssemblyProductAttribute)Attribute.GetCustomAttribute(asm, typeof(AssemblyProductAttribute));
+                string id = string.Format("{0}.{1}", asmcpn.Company, aspro.Product);
+                if (defaultKey != null)
+                {
+                    string checkId = defaultKey.GetValue("ProgId").ToString();
+                    if (checkId == "PDF Technologies, Inc..PDF Reader Pro" || checkId == id)
+                    {
+                        return true;
+                    }
+                    defaultKey.Close();
+                    if (checkId == (assemblyName.Name + ".pdf.1"))
+                    {
+                        return true;
+                    }
+                }
+
+            }
+            catch { }
+
+            return false;
+        }
+
+        /// <summary>
+        /// 判断当前程序是否以管理员身份运行
+        /// </summary>
+        /// <returns></returns>
+        public static bool IsRunAsAdmin()
+        {
+            WindowsIdentity id = WindowsIdentity.GetCurrent();
+            WindowsPrincipal principal = new WindowsPrincipal(id);
+            return principal.IsInRole(WindowsBuiltInRole.Administrator);
+        }
+    }
+}

+ 1 - 0
PDF Office/PDF Office.csproj

@@ -317,6 +317,7 @@
     <Compile Include="EventAggregators\SplitEvent.cs" />
     <Compile Include="EventAggregators\SplitEvent.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
+    <Compile Include="Helper\Win32Helper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />
     <Compile Include="Helper\AdvancedInvokeCommandAction.cs" />
     <Compile Include="Helper\AdvancedInvokeCommandAction.cs" />

+ 23 - 10
PDF Office/ViewModels/Dialog/SettingsDialogViewModel.cs

@@ -1,10 +1,12 @@
-using PDF_Office.Model.SettingsDialog;
+using PDF_Office.Helper;
+using PDF_Office.Model.SettingsDialog;
 using PDF_Office.Properties;
 using PDF_Office.Properties;
 using Prism.Commands;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
 using Prism.Services.Dialogs;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using System.Linq;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -27,11 +29,11 @@ namespace PDF_Office.ViewModels.Dialog
 
 
         public DelegateCommand ResetAllCommand { get; set; }
         public DelegateCommand ResetAllCommand { get; set; }
 
 
-        public List<string> AnnoteFamilyList { get; set; }
+        public ObservableCollection<string> AnnoteFamilyList { get; set; }
 
 
-        public List<string> PageViewList { get; set; }
+        public ObservableCollection<string> PageViewList { get; set; }
 
 
-        public List<string> ZoomModeList { get; set; }
+        public ObservableCollection<string> ZoomModeList { get; set; }
 
 
         private int noteSelectedIndex;
         private int noteSelectedIndex;
 
 
@@ -144,7 +146,7 @@ namespace PDF_Office.ViewModels.Dialog
         }
         }
 
 
 
 
-        private int modeSelectedIndex = 0;
+        private int modeSelectedIndex;
         //选中的模式
         //选中的模式
         public int ModeSelectedIndex
         public int ModeSelectedIndex
         {
         {
@@ -155,6 +157,7 @@ namespace PDF_Office.ViewModels.Dialog
             }
             }
         }
         }
 
 
+
         private bool isDefualtApp;
         private bool isDefualtApp;
 
 
         /// <summary>
         /// <summary>
@@ -179,7 +182,7 @@ namespace PDF_Office.ViewModels.Dialog
             }
             }
         }
         }
 
 
-        private int pageViewSelectedIndex = 0;
+        private int pageViewSelectedIndex;
 
 
         public int PageViewSelctedIndex
         public int PageViewSelctedIndex
         {
         {
@@ -191,7 +194,7 @@ namespace PDF_Office.ViewModels.Dialog
             }
             }
         }
         }
 
 
-        private int zoomModeSelectedIndex = 0;
+        private int zoomModeSelectedIndex ;
 
 
         public int ZoomModeSelectedIndex
         public int ZoomModeSelectedIndex
         {
         {
@@ -216,11 +219,15 @@ namespace PDF_Office.ViewModels.Dialog
             }
             }
         }
         }
 
 
+
         public SettingsDialogViewModel()
         public SettingsDialogViewModel()
         {
         {
             Annote = new AnnotateModel();
             Annote = new AnnotateModel();
             Descript = new DescriptionModel();
             Descript = new DescriptionModel();
             View = new InitialVIewModel();
             View = new InitialVIewModel();
+            PageViewList = new ObservableCollection<string>();
+            AnnoteFamilyList = new ObservableCollection<string>();
+            ZoomModeList = new ObservableCollection<string>();
 
 
             ResetAllCommand = new DelegateCommand(resetAll);
             ResetAllCommand = new DelegateCommand(resetAll);
             ResetCommand = new DelegateCommand(reset);
             ResetCommand = new DelegateCommand(reset);
@@ -231,6 +238,10 @@ namespace PDF_Office.ViewModels.Dialog
             //根据缓存还原下拉框 单选等
             //根据缓存还原下拉框 单选等
             InitAnnote();
             InitAnnote();
             InitView();
             InitView();
+
+            //判断是否以管理员身份运行
+            IsSetDefualtAppEnable = Win32Helper.IsRunAsAdmin();
+            IsDefualtApp = Win32Helper.IsDefaultApp();
         }
         }
 
 
         private void InitView()
         private void InitView()
@@ -310,7 +321,7 @@ namespace PDF_Office.ViewModels.Dialog
 
 
         private void InitPageViews()
         private void InitPageViews()
         {
         {
-            PageViewList = new List<string>();
+            PageViewList.Clear();
             PageViewList.Add("单页");
             PageViewList.Add("单页");
             PageViewList.Add("单页连续");
             PageViewList.Add("单页连续");
             PageViewList.Add("双页");
             PageViewList.Add("双页");
@@ -321,7 +332,7 @@ namespace PDF_Office.ViewModels.Dialog
 
 
         private void InitZoomMode()
         private void InitZoomMode()
         {
         {
-            ZoomModeList = new List<string>();
+            ZoomModeList.Clear();
             ZoomModeList.Add("适应宽度");
             ZoomModeList.Add("适应宽度");
             ZoomModeList.Add("适应页面");
             ZoomModeList.Add("适应页面");
             ZoomModeList.Add("实际大小");
             ZoomModeList.Add("实际大小");
@@ -329,7 +340,7 @@ namespace PDF_Office.ViewModels.Dialog
 
 
         private void InitAnnoteFamily()
         private void InitAnnoteFamily()
         {
         {
-            AnnoteFamilyList = new List<string>();
+            AnnoteFamilyList.Clear();
             AnnoteFamilyList.Add("Courier New");
             AnnoteFamilyList.Add("Courier New");
             AnnoteFamilyList.Add("Arial");
             AnnoteFamilyList.Add("Arial");
             AnnoteFamilyList.Add("Times New Roman");
             AnnoteFamilyList.Add("Times New Roman");
@@ -382,6 +393,8 @@ namespace PDF_Office.ViewModels.Dialog
                 View.Save();
                 View.Save();
                 Annote.Save();
                 Annote.Save();
                 Descript.Save();
                 Descript.Save();
+
+                Win32Helper.RegisterDefaultApp(IsDefualtApp);
                 Settings.Default.Save();
                 Settings.Default.Save();
             }
             }
             catch { }
             catch { }

+ 45 - 6
PDF Office/ViewModels/HomePanel/RecentFiles/RecentFilesContentViewModel.cs

@@ -167,10 +167,30 @@ namespace PDF_Office.ViewModels.HomePanel.RecentFiles
             var openFileInfo = obj as OpenFileInfo;
             var openFileInfo = obj as OpenFileInfo;
             if (openFileInfo != null)
             if (openFileInfo != null)
             {
             {
-                AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.HaveCheckBoxShow("提示", "删除文件", "不再提示", "取消", "OK");
+                bool needDelete = false;
+                //判断是否需要执行删除操作
+                if (!Settings.Default.AppProperties.DontTipBeforeDeleteRecent)
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.HaveCheckBoxShow("提示", "删除文件", "不再提示", "取消", "OK");
+                    if(alertsMessage.result == ContentResult.Ok)
+                    {
+                        needDelete = true;
+                        //已经勾选 下次不再提示
+                        Settings.Default.AppProperties.DontTipBeforeDeleteRecent = alertsMessage.isChecked;
+                        Settings.Default.Save();
+                    }
+                    else
+                    {
+                        needDelete = false;
+                    }
+                }
+                else
+                {
+                    needDelete = true;
+                }
 
 
-                if (alertsMessage.result == ContentResult.Ok)
+                if (needDelete)
                 {
                 {
                     SettingHelper.RemoveRecentOpenFile(openFileInfo.FilePath);
                     SettingHelper.RemoveRecentOpenFile(openFileInfo.FilePath);
                     RecentFilesGroup.Remove(openFileInfo);
                     RecentFilesGroup.Remove(openFileInfo);
@@ -216,9 +236,28 @@ namespace PDF_Office.ViewModels.HomePanel.RecentFiles
                     SelectedItemsType = 2;
                     SelectedItemsType = 2;
                 }
                 }
 
 
-                AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.HaveCheckBoxShow("提示", msg,"不再提示", "取消", "OK");
-                if (alertsMessage.result == ContentResult.Ok)
+                bool needDelete = false;
+                if (!Settings.Default.AppProperties.DontTipBeforeDeleteRecent)
+                {
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.HaveCheckBoxShow("提示", msg, "不再提示", "取消", "OK");
+                    if (alertsMessage.result == ContentResult.Ok)
+                    {
+                        needDelete = true;
+                        Settings.Default.AppProperties.DontTipBeforeDeleteRecent = alertsMessage.isChecked;
+                        Settings.Default.Save();
+                    }
+                    else
+                    {
+                        needDelete = false;
+                    }
+                }
+                else
+                {
+                    needDelete = true;
+                }
+
+                if (needDelete)
                 {
                 {
                     RemoveRecentFilesFrom(SelectedItemsType, openFileInfo);
                     RemoveRecentFilesFrom(SelectedItemsType, openFileInfo);
                 }
                 }

+ 7 - 21
PDF Office/Views/Dialog/SettingsDialog.xaml

@@ -114,7 +114,7 @@
             </Style>
             </Style>
         </ResourceDictionary>
         </ResourceDictionary>
     </UserControl.Resources>
     </UserControl.Resources>
-    <Grid>
+    <Grid Background="{StaticResource color.sys.layout.mg}">
         <Grid.RowDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition Height="40" />
             <RowDefinition Height="40" />
             <RowDefinition />
             <RowDefinition />
@@ -123,7 +123,6 @@
             Grid.Row="1"
             Grid.Row="1"
             BorderThickness="0"
             BorderThickness="0"
             SelectedIndex="{Binding ModeSelectedIndex, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"
             SelectedIndex="{Binding ModeSelectedIndex, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"
-            Style="{StaticResource InfoTabControl}"
             TabStripPlacement="Left">
             TabStripPlacement="Left">
             <TabItem x:Name="TabItemGeneral" Style="{StaticResource InfoTabItem}">
             <TabItem x:Name="TabItemGeneral" Style="{StaticResource InfoTabItem}">
                 <TabItem.Header>
                 <TabItem.Header>
@@ -310,14 +309,7 @@
                                         Width="348"
                                         Width="348"
                                         Height="30"
                                         Height="30"
                                         ItemsSource="{Binding PageViewList}"
                                         ItemsSource="{Binding PageViewList}"
-                                        SelectedIndex="{Binding PageViewSelctedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
-                                        <ComboBoxItem Content="单页" Foreground="{StaticResource color.field.text.act}" />
-                                        <ComboBoxItem Content="单页连续" Foreground="{StaticResource color.field.text.act}" />
-                                        <ComboBoxItem Content="双页" Foreground="{StaticResource color.field.text.act}" />
-                                        <ComboBoxItem Content="双页连续" Foreground="{StaticResource color.field.text.act}" />
-                                        <ComboBoxItem Content="书本" Foreground="{StaticResource color.field.text.act}" />
-                                        <ComboBoxItem Content="书本连续" Foreground="{StaticResource color.field.text.act}" />
-                                    </ComboBox>
+                                        SelectedIndex="{Binding PageViewSelctedIndex, Mode=TwoWay}" />
                                 </WrapPanel>
                                 </WrapPanel>
                                 <WrapPanel Grid.Row="1" Margin="0,12">
                                 <WrapPanel Grid.Row="1" Margin="0,12">
                                     <Label
                                     <Label
@@ -328,9 +320,7 @@
                                         Width="348"
                                         Width="348"
                                         Height="30"
                                         Height="30"
                                         ItemsSource="{Binding ZoomModeList}"
                                         ItemsSource="{Binding ZoomModeList}"
-                                        SelectedIndex="{Binding ZoomModeSelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
-  
-                                    </ComboBox>
+                                        SelectedIndex="{Binding ZoomModeSelectedIndex, Mode=TwoWay}" />
                                 </WrapPanel>
                                 </WrapPanel>
                             </Grid>
                             </Grid>
                         </Border>
                         </Border>
@@ -569,10 +559,8 @@
                                 <ComboBox
                                 <ComboBox
                                     Width="228"
                                     Width="228"
                                     Height="30"
                                     Height="30"
-                                    SelectedIndex="{Binding AnnoteSelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
-                                    <ComboBoxItem Content="系统字体" Foreground="{StaticResource color.field.text.act}" />
-                                    <ComboBoxItem Content="PingFang" Foreground="{StaticResource color.field.text.act}" />
-                                </ComboBox>
+                                    ItemsSource="{Binding AnnoteFamilyList}"
+                                    SelectedIndex="{Binding AnnoteSelectedIndex}" />
                                 <RadioButton
                                 <RadioButton
                                     Name="RbtLeft"
                                     Name="RbtLeft"
                                     Width="32"
                                     Width="32"
@@ -734,10 +722,8 @@
                                 <ComboBox
                                 <ComboBox
                                     Width="228"
                                     Width="228"
                                     Height="30"
                                     Height="30"
-                                    SelectedIndex="{Binding NoteSelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
-                                    <ComboBoxItem Content="系统字体" Foreground="{StaticResource color.field.text.act}" />
-                                    <ComboBoxItem Content="PingFang" Foreground="{StaticResource color.field.text.act}" />
-                                </ComboBox>
+                                    ItemsSource="{Binding AnnoteFamilyList}"
+                                    SelectedIndex="{Binding NoteSelectedIndex, Mode=TwoWay}" />
                             </WrapPanel>
                             </WrapPanel>
                         </WrapPanel>
                         </WrapPanel>
                     </StackPanel>
                     </StackPanel>

+ 25 - 10
PDF Office/Views/HomeContent.xaml

@@ -8,7 +8,8 @@
     xmlns:homePanel="clr-namespace:PDF_Office.Views.HomePanel"
     xmlns:homePanel="clr-namespace:PDF_Office.Views.HomePanel"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     xmlns:prism="http://prismlibrary.com/"
-    xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels" d:DataContext="{d:DesignInstance Type=viewmodels:HomeContentViewModel}"
+    xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
+    d:DataContext="{d:DesignInstance Type=viewmodels:HomeContentViewModel}"
     d:DesignHeight="450"
     d:DesignHeight="450"
     d:DesignWidth="800"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -74,17 +75,28 @@
                     Content="Create PDF"
                     Content="Create PDF"
                     FontSize="16"
                     FontSize="16"
                     Initialized="BtnCreatPDF_Initialized"
                     Initialized="BtnCreatPDF_Initialized"
-                    Style="{StaticResource btn.sec}" >
+                    Style="{StaticResource btn.sec}">
                     <Button.ContextMenu>
                     <Button.ContextMenu>
                         <ContextMenu Name="ContextCreatePDF">
                         <ContextMenu Name="ContextCreatePDF">
-                            <MenuItem Header="New Blank Page" Command="{Binding CreateBlackPDFCommand}"/>
-                            <MenuItem Header="New From Web Page" Command="{Binding CreateFromHtmlCommnd}"/>
-                            <MenuItem Header="Import From Scanner" Command="{Binding CreateFromScanner}"/>
+                            <MenuItem Command="{Binding CreateBlackPDFCommand}" Header="New Blank Page" />
+                            <MenuItem Command="{Binding CreateFromHtmlCommnd}" Visibility="Collapsed" Header="New From Web Page" />
+                            <MenuItem Command="{Binding CreateFromScanner}" Header="Import From Scanner" />
                         </ContextMenu>
                         </ContextMenu>
                     </Button.ContextMenu>
                     </Button.ContextMenu>
                 </Button>
                 </Button>
-                <Button Name="BtnExpand" Width="26" Height="32" HorizontalAlignment="Right" Click="BtnExpand_Click"  Margin="4" Style="{StaticResource btn.icon-fill}">
-                    <Path Width="12" Height="12" Data="M6 7.56434L2.03039 3.59473L0.969727 4.65539L5.46967 9.15533C5.76256 9.44822 6.23743 9.44822 6.53033 9.15533L11.0303 4.65539L9.9696 3.59473L6 7.56434Z" Fill="{StaticResource color.icon.arrow.gray.def}"/>
+                <Button
+                    Name="BtnExpand"
+                    Width="26"
+                    Height="32"
+                    Margin="4"
+                    HorizontalAlignment="Right"
+                    Click="BtnExpand_Click"
+                    Style="{StaticResource btn.icon-fill}">
+                    <Path
+                        Width="12"
+                        Height="12"
+                        Data="M6 7.56434L2.03039 3.59473L0.969727 4.65539L5.46967 9.15533C5.76256 9.44822 6.23743 9.44822 6.53033 9.15533L11.0303 4.65539L9.9696 3.59473L6 7.56434Z"
+                        Fill="{StaticResource color.icon.arrow.gray.def}" />
                 </Button>
                 </Button>
             </Grid>
             </Grid>
 
 
@@ -98,7 +110,8 @@
                 Command="{Binding ShowToolCommand}"
                 Command="{Binding ShowToolCommand}"
                 CommandParameter="Guid"
                 CommandParameter="Guid"
                 Style="{StaticResource ToggleBtnSelectStyle}"
                 Style="{StaticResource ToggleBtnSelectStyle}"
-                Tag="GridMode">
+                Tag="GridMode"
+                Visibility="Collapsed">
                 <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
                 <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
                     <Path Data="M3.8655 5.79653C3.32363 6.16977 3 6.78565 3 7.44363V15C3 16.1046 3.89543 17 5 17H9V13.1785C9 12.6262 9.44772 12.1785 10 12.1785C10.5523 12.1785 11 12.6262 11 13.1785V17H15C16.1046 17 17 16.1046 17 15V7.44363C17 6.78565 16.6764 6.16977 16.1345 5.79653L11.1345 2.3526C10.4514 1.88206 9.54865 1.88206 8.8655 2.3526L3.8655 5.79653Z" Fill="{Binding ElementName=BtnGuid, Path=Foreground}" />
                     <Path Data="M3.8655 5.79653C3.32363 6.16977 3 6.78565 3 7.44363V15C3 16.1046 3.89543 17 5 17H9V13.1785C9 12.6262 9.44772 12.1785 10 12.1785C10.5523 12.1785 11 12.6262 11 13.1785V17H15C16.1046 17 17 16.1046 17 15V7.44363C17 6.78565 16.6764 6.16977 16.1345 5.79653L11.1345 2.3526C10.4514 1.88206 9.54865 1.88206 8.8655 2.3526L3.8655 5.79653Z" Fill="{Binding ElementName=BtnGuid, Path=Foreground}" />
                     <TextBlock
                     <TextBlock
@@ -120,7 +133,8 @@
                 Command="{Binding ShowToolCommand}"
                 Command="{Binding ShowToolCommand}"
                 CommandParameter="Tools"
                 CommandParameter="Tools"
                 Style="{StaticResource ToggleBtnSelectStyle}"
                 Style="{StaticResource ToggleBtnSelectStyle}"
-                Tag="GridMode">
+                Tag="GridMode"
+                Visibility="Collapsed">
                 <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
                 <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
                     <Path Data="M3.8655 5.79653C3.32363 6.16977 3 6.78565 3 7.44363V15C3 16.1046 3.89543 17 5 17H9V13.1785C9 12.6262 9.44772 12.1785 10 12.1785C10.5523 12.1785 11 12.6262 11 13.1785V17H15C16.1046 17 17 16.1046 17 15V7.44363C17 6.78565 16.6764 6.16977 16.1345 5.79653L11.1345 2.3526C10.4514 1.88206 9.54865 1.88206 8.8655 2.3526L3.8655 5.79653Z" Fill="{Binding ElementName=BtnTool, Path=Foreground}" />
                     <Path Data="M3.8655 5.79653C3.32363 6.16977 3 6.78565 3 7.44363V15C3 16.1046 3.89543 17 5 17H9V13.1785C9 12.6262 9.44772 12.1785 10 12.1785C10.5523 12.1785 11 12.6262 11 13.1785V17H15C16.1046 17 17 16.1046 17 15V7.44363C17 6.78565 16.6764 6.16977 16.1345 5.79653L11.1345 2.3526C10.4514 1.88206 9.54865 1.88206 8.8655 2.3526L3.8655 5.79653Z" Fill="{Binding ElementName=BtnTool, Path=Foreground}" />
                     <TextBlock
                     <TextBlock
@@ -142,7 +156,8 @@
                 Command="{Binding ShowToolCommand}"
                 Command="{Binding ShowToolCommand}"
                 CommandParameter="Cloud"
                 CommandParameter="Cloud"
                 Style="{StaticResource ToggleBtnSelectStyle}"
                 Style="{StaticResource ToggleBtnSelectStyle}"
-                Tag="GridMode">
+                Tag="GridMode"
+                Visibility="Collapsed">
                 <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
                 <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
                     <Path Data="M14.95 16.5H5.5C3.01472 16.5 1 14.4853 1 12C1 9.51472 3.01472 7.5 5.5 7.5L5.52018 7.50004C5.74751 4.9771 7.86787 3 10.45 3C13.1838 3 15.4 5.21619 15.4 7.95C15.4 8.10931 15.3925 8.26686 15.3778 8.42232C17.4134 8.63601 19 10.3577 19 12.45C19 14.6701 17.2137 16.4729 15 16.4997V16.5H14.95Z" Fill="{Binding ElementName=BtnCloud, Path=Foreground}" />
                     <Path Data="M14.95 16.5H5.5C3.01472 16.5 1 14.4853 1 12C1 9.51472 3.01472 7.5 5.5 7.5L5.52018 7.50004C5.74751 4.9771 7.86787 3 10.45 3C13.1838 3 15.4 5.21619 15.4 7.95C15.4 8.10931 15.3925 8.26686 15.3778 8.42232C17.4134 8.63601 19 10.3577 19 12.45C19 14.6701 17.2137 16.4729 15 16.4997V16.5H14.95Z" Fill="{Binding ElementName=BtnCloud, Path=Foreground}" />
                     <TextBlock
                     <TextBlock

+ 70 - 67
PDF Office/Views/HomePanel/PDFTools/QuickToolsContent.xaml

@@ -2,74 +2,71 @@
     x:Class="PDF_Office.Views.HomePanel.PDFTools.QuickToolsContent"
     x:Class="PDF_Office.Views.HomePanel.PDFTools.QuickToolsContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:converter="clr-namespace:PDF_Office.DataConvert"
+    xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.Views.HomePanel"
     xmlns:local="clr-namespace:PDF_Office.Views.HomePanel"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
-    xmlns:converter="clr-namespace:PDF_Office.DataConvert"
     xmlns:pDFTools="clr-namespace:PDF_Office.Views.HomePanel.PDFTools"
     xmlns:pDFTools="clr-namespace:PDF_Office.Views.HomePanel.PDFTools"
-    xmlns:prism ="http://prismlibrary.com/"
-    prism:ViewModelLocator.AutoWireViewModel="True"
+    xmlns:prism="http://prismlibrary.com/"
     d:DesignHeight="450"
     d:DesignHeight="450"
     d:DesignWidth="800"
     d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
     Loaded="UserControl_Loaded"
     Loaded="UserControl_Loaded"
     mc:Ignorable="d">
     mc:Ignorable="d">
     <UserControl.Resources>
     <UserControl.Resources>
         <ResourceDictionary>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/CustomListItemStyle.xaml"/>
+                <ResourceDictionary Source="../../../Styles/CustomListItemStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
             </ResourceDictionary.MergedDictionaries>
             <converter:BoolToVisible x:Key="BoolToVisibilityConverter" />
             <converter:BoolToVisible x:Key="BoolToVisibilityConverter" />
-            <converter:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
-            <Style x:Key="LabelSty"
-               TargetType="{x:Type Label}">
-                <Setter Property="Padding"
-                    Value="10,5" />
-                <Setter Property="Background"
-                    Value="CadetBlue" />
-                <Setter Property="Foreground"
-                    Value="White" />
+            <converter:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
+            <Style x:Key="LabelSty" TargetType="{x:Type Label}">
+                <Setter Property="Padding" Value="10,5" />
+                <Setter Property="Background" Value="CadetBlue" />
+                <Setter Property="Foreground" Value="White" />
             </Style>
             </Style>
 
 
             <DataTemplate x:Key="DataTemplate">
             <DataTemplate x:Key="DataTemplate">
-                <pDFTools:PDFToolItem x:Name="data" Cursor="Hand"/>
+                <pDFTools:PDFToolItem x:Name="data" Cursor="Hand" />
             </DataTemplate>
             </DataTemplate>
 
 
             <DataTemplate x:Key="ExpendDataTemplate">
             <DataTemplate x:Key="ExpendDataTemplate">
-                <pDFTools:PDFToolExpendItem x:Name="Expenddata" Cursor="Hand"/>
+                <pDFTools:PDFToolExpendItem x:Name="Expenddata" Cursor="Hand" />
             </DataTemplate>
             </DataTemplate>
 
 
             <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
             <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
-                <WrapPanel AllowDrop="True"
-                       Orientation="Horizontal" />
+                <WrapPanel AllowDrop="True" Orientation="Horizontal" />
             </ItemsPanelTemplate>
             </ItemsPanelTemplate>
 
 
-            <Style x:Key="QuickToolsListBoxItemStyle" BasedOn="{StaticResource ListBoxItemStyle}"
-               TargetType="{x:Type customControl:ListItemQuickTool}">
-                <EventSetter Event="PreviewMouseLeftButtonUp"
-                             Handler="QuickTools_Click"/>
+            <Style
+                x:Key="QuickToolsListBoxItemStyle"
+                BasedOn="{StaticResource ListBoxItemStyle}"
+                TargetType="{x:Type customControl:ListItemQuickTool}">
+                <EventSetter Event="PreviewMouseLeftButtonUp" Handler="QuickTools_Click" />
 
 
             </Style>
             </Style>
 
 
         </ResourceDictionary>
         </ResourceDictionary>
-        
+
     </UserControl.Resources>
     </UserControl.Resources>
     <Grid Grid.ColumnSpan="2" Margin="0,0,20,0">
     <Grid Grid.ColumnSpan="2" Margin="0,0,20,0">
         <Grid.RowDefinitions>
         <Grid.RowDefinitions>
-            <RowDefinition Height="Auto"/>
-            <RowDefinition Height="*"/>
+            <RowDefinition Height="Auto" />
+            <RowDefinition Height="*" />
         </Grid.RowDefinitions>
         </Grid.RowDefinitions>
         <TextBlock
         <TextBlock
-                x:Name="TxbQuickToolsTitle"
-                Margin="0,0,0,16"
-                FontSize="24"
-                FontWeight="SemiBold"
-                Text="Quick Tools" />
+            x:Name="TxbQuickToolsTitle"
+            Margin="0,0,0,16"
+            FontSize="24"
+            FontWeight="SemiBold"
+            Text="Quick Tools" />
 
 
 
 
         <StackPanel
         <StackPanel
-            x:Name="PnlToolsUIBtns" Grid.ColumnSpan="2"
-            Grid.Column="0" 
+            x:Name="PnlToolsUIBtns"
+            Grid.Column="0"
+            Grid.ColumnSpan="2"
             Margin="0,0,12,0"
             Margin="0,0,12,0"
             HorizontalAlignment="Right"
             HorizontalAlignment="Right"
             VerticalAlignment="Top"
             VerticalAlignment="Top"
@@ -81,51 +78,57 @@
                 Width="68"
                 Width="68"
                 Height="28"
                 Height="28"
                 Margin="0,0,0,0"
                 Margin="0,0,0,0"
-                Content="Tools"
                 Command="{Binding ShowToolCommand}"
                 Command="{Binding ShowToolCommand}"
-               >
-
-            </Button>
+                Content="Tools"
+                Visibility="Collapsed" />
             <Button
             <Button
                 x:Name="BtnMore"
                 x:Name="BtnMore"
                 Width="28"
                 Width="28"
                 Height="28"
                 Height="28"
                 Margin="12,0,0,0"
                 Margin="12,0,0,0"
-                 Background="#FFFFFF" BorderThickness="0" Content="..."
-                Command="{Binding OpenMenuCommand}" CommandParameter="{Binding ElementName=BtnMore}"
-               >
-            </Button>
+                Background="#FFFFFF"
+                BorderThickness="0"
+                Command="{Binding OpenMenuCommand}"
+                CommandParameter="{Binding ElementName=BtnMore}"
+                Content="..." />
 
 
         </StackPanel>
         </StackPanel>
 
 
         <Grid
         <Grid
-                x:Name="GridAllTools"
-                Grid.Row="1" Height="270"
-                SizeChanged="GridAllTools_SizeChanged">
-
-            <customControl:ListBoxEx x:Name="ListBoxExpendToolBars" HorizontalAlignment="Stretch"  MinWidth="540" 
-                        Grid.Row="3"
-                        AllowDrop="True"
-                        BorderThickness="0" Background="Transparent"
-                        ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
-                        ItemTemplate="{StaticResource ExpendDataTemplate}"
-                        ItemsPanel="{StaticResource ListItemsPanelTemplate}"
-                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
-                        SelectionMode="Single" 
-                        Visibility="{Binding IsExpendTools,Converter={StaticResource BoolToVisibilityConverter}}"
-                                     />
-
-            <customControl:ListBoxEx x:Name="ListBoxToolBars" HorizontalAlignment="Stretch"  MinWidth="540" 
-                        Grid.Row="3"
-                        AllowDrop="True"
-                        BorderThickness="0" Background="Transparent"
-                        ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
-                        ItemTemplate="{StaticResource DataTemplate}"
-                        ItemsPanel="{StaticResource ListItemsPanelTemplate}"
-                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
-                        SelectionMode="Single" 
-                         Visibility="{Binding IsExpendTools,Converter={StaticResource InvertBoolToVisibleConvert}}"             
-                                     />
+            x:Name="GridAllTools"
+            Grid.Row="1"
+            Height="270"
+            SizeChanged="GridAllTools_SizeChanged">
+
+            <customControl:ListBoxEx
+                x:Name="ListBoxExpendToolBars"
+                Grid.Row="3"
+                MinWidth="540"
+                HorizontalAlignment="Stretch"
+                AllowDrop="True"
+                Background="Transparent"
+                BorderThickness="0"
+                ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
+                ItemTemplate="{StaticResource ExpendDataTemplate}"
+                ItemsPanel="{StaticResource ListItemsPanelTemplate}"
+                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                SelectionMode="Single"
+                Visibility="{Binding IsExpendTools, Converter={StaticResource BoolToVisibilityConverter}}" />
+
+            <customControl:ListBoxEx
+                x:Name="ListBoxToolBars"
+                Grid.Row="3"
+                MinWidth="540"
+                HorizontalAlignment="Stretch"
+                AllowDrop="True"
+                Background="Transparent"
+                BorderThickness="0"
+                ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
+                ItemTemplate="{StaticResource DataTemplate}"
+                ItemsPanel="{StaticResource ListItemsPanelTemplate}"
+                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                SelectionMode="Single"
+                Visibility="{Binding IsExpendTools, Converter={StaticResource InvertBoolToVisibleConvert}}" />
 
 
         </Grid>
         </Grid>
 
 

+ 269 - 112
PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml

@@ -1,16 +1,19 @@
-<UserControl x:Class="PDF_Office.Views.HomePanel.RecentFiles.RecentFilesContent"
-             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.HomePanel.RecentFiles"
-             xmlns:customControl ="clr-namespace:PDF_Office.CustomControl"
-             xmlns:DataConvert ="clr-namespace:PDF_Office.DataConvert"
-             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
-             xmlns:prism ="http://prismlibrary.com/"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             mc:Ignorable="d" Loaded="UserControl_Loaded"
-             d:DesignHeight="450" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.Views.HomePanel.RecentFiles.RecentFilesContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:DataConvert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.HomePanel.RecentFiles"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    Loaded="UserControl_Loaded"
+    mc:Ignorable="d">
     <UserControl.Resources>
     <UserControl.Resources>
         <ResourceDictionary>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
             <ResourceDictionary.MergedDictionaries>
@@ -24,9 +27,10 @@
             <DataConvert:InvertBoolConvert x:Key="InvertBoolConvert" />
             <DataConvert:InvertBoolConvert x:Key="InvertBoolConvert" />
 
 
             <DataTemplate x:Key="listviewItem">
             <DataTemplate x:Key="listviewItem">
-                <local:DocItemListViewControl HorizontalAlignment="Stretch"
-                                              OpenFileItemHandler ="DocItemListViewControl_OpenFileItemHandler"
-                                              DeleteItemHandler="DocItemListViewControl_DeleteItemHandler" />
+                <local:DocItemListViewControl
+                    HorizontalAlignment="Stretch"
+                    DeleteItemHandler="DocItemListViewControl_DeleteItemHandler"
+                    OpenFileItemHandler="DocItemListViewControl_OpenFileItemHandler" />
             </DataTemplate>
             </DataTemplate>
 
 
             <DataTemplate x:Key="gridviewItem">
             <DataTemplate x:Key="gridviewItem">
@@ -41,18 +45,23 @@
                 <WrapPanel />
                 <WrapPanel />
             </ItemsPanelTemplate>
             </ItemsPanelTemplate>
 
 
-            <ContextMenu x:Key="FlyoutMenu" FontSize="14"
-                         Opened="ContextMenu_Opened">
+            <ContextMenu
+                x:Key="FlyoutMenu"
+                FontSize="14"
+                Opened="ContextMenu_Opened">
                 <ContextMenu.ItemContainerStyle>
                 <ContextMenu.ItemContainerStyle>
                     <Style TargetType="MenuItem">
                     <Style TargetType="MenuItem">
                         <Setter Property="Padding" Value="0,7,0,7" />
                         <Setter Property="Padding" Value="0,7,0,7" />
                         <Setter Property="VerticalContentAlignment" Value="Center" />
                         <Setter Property="VerticalContentAlignment" Value="Center" />
                     </Style>
                     </Style>
                 </ContextMenu.ItemContainerStyle>
                 </ContextMenu.ItemContainerStyle>
-                <MenuItem Name="FilePathMenuItem" Header="打开文件路径" IsEnabled="True" Click="FilePathMenuItem_Click">
+                <MenuItem
+                    Name="FilePathMenuItem"
+                    Click="FilePathMenuItem_Click"
+                    Header="打开文件路径"
+                    IsEnabled="True">
                     <MenuItem.Icon>
                     <MenuItem.Icon>
-                        <Path Fill="Black"
-                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
+                        <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
                             <Path.RenderTransform>
                             <Path.RenderTransform>
                                 <TranslateTransform X="3.0000" Y="0" />
                                 <TranslateTransform X="3.0000" Y="0" />
                             </Path.RenderTransform>
                             </Path.RenderTransform>
@@ -60,9 +69,13 @@
                     </MenuItem.Icon>
                     </MenuItem.Icon>
                 </MenuItem>
                 </MenuItem>
 
 
-                <MenuItem Name="DeleteMenuItem" Header="从最近列表删除" IsEnabled="True" Click="DeleteMenuItem_Click">
+                <MenuItem
+                    Name="DeleteMenuItem"
+                    Click="DeleteMenuItem_Click"
+                    Header="从最近列表删除"
+                    IsEnabled="True">
                     <MenuItem.Icon>
                     <MenuItem.Icon>
-                        <Path Fill="Black" Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z">
+                        <Path Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z" Fill="Black">
                             <Path.RenderTransform>
                             <Path.RenderTransform>
                                 <TranslateTransform X="5.0000" Y="0" />
                                 <TranslateTransform X="5.0000" Y="0" />
                             </Path.RenderTransform>
                             </Path.RenderTransform>
@@ -71,24 +84,25 @@
                 </MenuItem>
                 </MenuItem>
             </ContextMenu>
             </ContextMenu>
 
 
-            <Style x:Key="SubFilesListViewItemStyle" BasedOn="{StaticResource FilesListViewItemStyle}" TargetType="{x:Type ListViewItem}">
+            <Style
+                x:Key="SubFilesListViewItemStyle"
+                BasedOn="{StaticResource FilesListViewItemStyle}"
+                TargetType="{x:Type ListViewItem}">
                 <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
                 <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
                 <Setter Property="HorizontalContentAlignment" Value="Center" />
                 <Setter Property="HorizontalContentAlignment" Value="Center" />
                 <Setter Property="Margin" Value="0,0,0,0" />
                 <Setter Property="Margin" Value="0,0,0,0" />
-                <EventSetter Event="PreviewMouseRightButtonDown"
-                             Handler="ListViewItem_PreviewMouseRightButtonDown" />
-                <EventSetter Event="PreviewMouseDoubleClick"
-                             Handler="RecentFilesList_PreviewMouseDoubleClick">
-                </EventSetter>
+                <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
+                <EventSetter Event="PreviewMouseDoubleClick" Handler="RecentFilesList_PreviewMouseDoubleClick" />
             </Style>
             </Style>
 
 
-            <Style x:Key="HomeGridViewItemStyle" BasedOn="{StaticResource FilesGridItemStyle}" TargetType="{x:Type ListViewItem}">
+            <Style
+                x:Key="HomeGridViewItemStyle"
+                BasedOn="{StaticResource FilesGridItemStyle}"
+                TargetType="{x:Type ListViewItem}">
                 <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
                 <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
                 <Setter Property="HorizontalContentAlignment" Value="Center" />
                 <Setter Property="HorizontalContentAlignment" Value="Center" />
-                <EventSetter Event="PreviewMouseRightButtonDown"
-                             Handler="ListViewItem_PreviewMouseRightButtonDown" />
-                <EventSetter Event="PreviewMouseDoubleClick"
-                             Handler="RecentFilesList_PreviewMouseDoubleClick" />
+                <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
+                <EventSetter Event="PreviewMouseDoubleClick" Handler="RecentFilesList_PreviewMouseDoubleClick" />
             </Style>
             </Style>
         </ResourceDictionary>
         </ResourceDictionary>
     </UserControl.Resources>
     </UserControl.Resources>
@@ -101,31 +115,74 @@
                 <RowDefinition />
                 <RowDefinition />
             </Grid.RowDefinitions>
             </Grid.RowDefinitions>
             <Grid x:Name="GridRecentFilesTile" Margin="32,38,0,13">
             <Grid x:Name="GridRecentFilesTile" Margin="32,38,0,13">
-                <TextBlock x:Name="TxbRecentlyTile" Text="Recent" HorizontalAlignment="Left" FontWeight="Semibold" FontSize="20" Padding="0,6,0,0" Margin="0,0,0,0" />
-                <StackPanel x:Name="PnlRightBtns" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
-                    <Border  Background="#EEF2F3" Height="30" CornerRadius="4" Padding="1,0,1,0">
+                <TextBlock
+                    x:Name="TxbRecentlyTile"
+                    Margin="0,0,0,0"
+                    Padding="0,6,0,0"
+                    HorizontalAlignment="Left"
+                    FontSize="20"
+                    FontWeight="Semibold"
+                    Text="Recent" />
+                <StackPanel
+                    x:Name="PnlRightBtns"
+                    Grid.Column="0"
+                    Grid.ColumnSpan="2"
+                    Margin="0,0,0,0"
+                    HorizontalAlignment="Right"
+                    Orientation="Horizontal">
+                    <Border
+                        Height="30"
+                        Padding="1,0,1,0"
+                        Background="#EEF2F3"
+                        CornerRadius="4">
                         <StackPanel Orientation="Horizontal">
                         <StackPanel Orientation="Horizontal">
-                            <RadioButton x:Name="BtnListMode" GroupName="Mode" Tag="ListMode" Width="40" Height="28" Foreground="#333333"
-                                         HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
-                                         IsChecked="{Binding IsListMode,Mode=OneTime}"
-                                         Style="{StaticResource ListModeRadioBtnStyle}">
-                                <Grid  Margin="-5,0,0,0" HorizontalAlignment="Center">
-                                    <Path Data="M3 5L17 5" Stroke="{Binding ElementName=BtnListMode,Path=Foreground}" StrokeThickness="1.5" StrokeStartLineCap="Round" />
-                                    <Path Data="M3 10H17" Stroke="{Binding ElementName=BtnListMode,Path=Foreground}" StrokeThickness="1.5" StrokeStartLineCap="Round" />
-                                    <Path Data="M3 15H17" Stroke="{Binding ElementName=BtnListMode,Path=Foreground}" StrokeThickness="1.5" StrokeStartLineCap="Round" />
+                            <RadioButton
+                                x:Name="BtnListMode"
+                                Width="40"
+                                Height="28"
+                                HorizontalContentAlignment="Center"
+                                VerticalContentAlignment="Center"
+                                Foreground="#333333"
+                                GroupName="Mode"
+                                IsChecked="{Binding IsListMode, Mode=OneTime}"
+                                Style="{StaticResource ListModeRadioBtnStyle}"
+                                Tag="ListMode">
+                                <Grid Margin="-5,0,0,0" HorizontalAlignment="Center">
+                                    <Path
+                                        Data="M3 5L17 5"
+                                        Stroke="{Binding ElementName=BtnListMode, Path=Foreground}"
+                                        StrokeStartLineCap="Round"
+                                        StrokeThickness="1.5" />
+                                    <Path
+                                        Data="M3 10H17"
+                                        Stroke="{Binding ElementName=BtnListMode, Path=Foreground}"
+                                        StrokeStartLineCap="Round"
+                                        StrokeThickness="1.5" />
+                                    <Path
+                                        Data="M3 15H17"
+                                        Stroke="{Binding ElementName=BtnListMode, Path=Foreground}"
+                                        StrokeStartLineCap="Round"
+                                        StrokeThickness="1.5" />
                                 </Grid>
                                 </Grid>
                                 <i:Interaction.Triggers>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnListMode,Path =Tag}" />
+                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnListMode, Path=Tag}" />
                                     </i:EventTrigger>
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 </i:Interaction.Triggers>
                             </RadioButton>
                             </RadioButton>
 
 
-                            <RadioButton x:Name="BtnGridMode" GroupName="Mode" Tag="GridMode" Width="40" Height="28" Foreground="#6B869C"
-                                         HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
-                                         IsChecked="{Binding IsListMode,Converter={StaticResource InvertBoolConvert},Mode=OneTime}"
-                                         Style="{StaticResource ListModeRadioBtnStyle}">
-                                <Grid  Margin="-5,0,0,0" HorizontalAlignment="Center">
+                            <RadioButton
+                                x:Name="BtnGridMode"
+                                Width="40"
+                                Height="28"
+                                HorizontalContentAlignment="Center"
+                                VerticalContentAlignment="Center"
+                                Foreground="#6B869C"
+                                GroupName="Mode"
+                                IsChecked="{Binding IsListMode, Converter={StaticResource InvertBoolConvert}, Mode=OneTime}"
+                                Style="{StaticResource ListModeRadioBtnStyle}"
+                                Tag="GridMode">
+                                <Grid Margin="-5,0,0,0" HorizontalAlignment="Center">
                                     <Grid.RowDefinitions>
                                     <Grid.RowDefinitions>
                                         <RowDefinition />
                                         <RowDefinition />
                                         <RowDefinition />
                                         <RowDefinition />
@@ -134,97 +191,197 @@
                                         <ColumnDefinition />
                                         <ColumnDefinition />
                                         <ColumnDefinition />
                                         <ColumnDefinition />
                                     </Grid.ColumnDefinitions>
                                     </Grid.ColumnDefinitions>
-                                    <Rectangle Grid.Row="0" Grid.Column="0" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
-                                    <Rectangle Grid.Row="0" Grid.Column="1"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
-                                    <Rectangle Grid.Row="1" Grid.Column="0"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
-                                    <Rectangle Grid.Row="1" Grid.Column="1"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
+                                    <Rectangle
+                                        Grid.Row="0"
+                                        Grid.Column="0"
+                                        Width="5"
+                                        Height="5"
+                                        Margin="1"
+                                        Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
+                                        StrokeDashCap="Round"
+                                        StrokeThickness="1.5" />
+                                    <Rectangle
+                                        Grid.Row="0"
+                                        Grid.Column="1"
+                                        Width="5"
+                                        Height="5"
+                                        Margin="1"
+                                        Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
+                                        StrokeDashCap="Round"
+                                        StrokeThickness="1.5" />
+                                    <Rectangle
+                                        Grid.Row="1"
+                                        Grid.Column="0"
+                                        Width="5"
+                                        Height="5"
+                                        Margin="1"
+                                        Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
+                                        StrokeDashCap="Round"
+                                        StrokeThickness="1.5" />
+                                    <Rectangle
+                                        Grid.Row="1"
+                                        Grid.Column="1"
+                                        Width="5"
+                                        Height="5"
+                                        Margin="1"
+                                        Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
+                                        StrokeDashCap="Round"
+                                        StrokeThickness="1.5" />
                                 </Grid>
                                 </Grid>
                                 <i:Interaction.Triggers>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnGridMode,Path =Tag}" />
+                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnGridMode, Path=Tag}" />
                                     </i:EventTrigger>
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                                 </i:Interaction.Triggers>
                             </RadioButton>
                             </RadioButton>
                         </StackPanel>
                         </StackPanel>
                     </Border>
                     </Border>
 
 
-                    <Separator  Margin="1 0 1 0" Width="1" Height="16" BorderBrush="#1A000000" BorderThickness="1" />
+                    <Separator
+                        Width="1"
+                        Height="16"
+                        Margin="1,0,1,0"
+                        BorderBrush="#1A000000"
+                        BorderThickness="1" />
 
 
-                    <Button x:Name="BtnDelete" Margin="0" Padding="0,0,0,0" MaxHeight="40" Width="28" Height="28" Background="Transparent" BorderThickness="0"
-                            IsEnabled="{Binding IsEmpty,Converter={StaticResource InvertBoolConvert},Mode=OneWay}"
-                            Command="{Binding RemoveFilesFromContainerCommand}" CommandParameter="{Binding ElementName=RecentFilesList,Path=SelectedItems}"
-                            Style="{StaticResource OnlyContentBtn}" Foreground="#6B6F7D">
+                    <Button
+                        x:Name="BtnDelete"
+                        Width="28"
+                        Height="28"
+                        MaxHeight="40"
+                        Margin="0"
+                        Padding="0,0,0,0"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        Command="{Binding RemoveFilesFromContainerCommand}"
+                        CommandParameter="{Binding ElementName=RecentFilesList, Path=SelectedItems}"
+                        Foreground="#6B6F7D"
+                        IsEnabled="{Binding IsEmpty, Converter={StaticResource InvertBoolConvert}, Mode=OneWay}"
+                        Style="{StaticResource OnlyContentBtn}">
                         <Grid Width="20" Height="20">
                         <Grid Width="20" Height="20">
-                            <Path Data="M8 2H12" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
-                            <Path Data="M5 5V17H15V5" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
-                            <Path Data="M17 5H3" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
-                            <Path Data="M10 9V13" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
+                            <Path
+                                Data="M8 2H12"
+                                Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
+                                StrokeDashCap="Round"
+                                StrokeThickness="2" />
+                            <Path
+                                Data="M5 5V17H15V5"
+                                Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
+                                StrokeDashCap="Round"
+                                StrokeThickness="2" />
+                            <Path
+                                Data="M17 5H3"
+                                Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
+                                StrokeDashCap="Round"
+                                StrokeThickness="2" />
+                            <Path
+                                Data="M10 9V13"
+                                Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
+                                StrokeDashCap="Round"
+                                StrokeThickness="2" />
                         </Grid>
                         </Grid>
                     </Button>
                     </Button>
                 </StackPanel>
                 </StackPanel>
             </Grid>
             </Grid>
 
 
-            <Grid  Grid.Row="2" Visibility="{Binding IsEmpty,Converter={StaticResource InvertBoolToVisibleConvert}}">
+            <Grid Grid.Row="2" Visibility="{Binding IsEmpty, Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid.ColumnDefinitions>
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="799*" />
                     <ColumnDefinition Width="799*" />
                     <ColumnDefinition Width="*" />
                     <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
                 </Grid.ColumnDefinitions>
-                <Border Visibility="{Binding IsListMode,Converter={StaticResource BoolToVisible}}">
-                    <ListView x:Name="RecentFilesList"
-                              ItemsSource="{Binding RecentFilesGroup}"
-                              Margin="32,0,0,0"
-                              VirtualizingPanel.IsVirtualizing="True"
-                              VirtualizingPanel.CacheLengthUnit="Page"
-                              VirtualizingPanel.CacheLength="1"
-                              VirtualizingPanel.ScrollUnit="Pixel"
-                              ScrollViewer.HorizontalScrollBarVisibility="Disabled"
-                              ScrollViewer.VerticalScrollBarVisibility="Auto"
-                              Background="Transparent" BorderThickness="0"
-                              Padding="0,0,0,0" MinHeight="216" MinWidth="380"
-                              SelectionMode="Multiple"
-                              ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
-                              Style="{StaticResource FilesListViewStyle}"
-                              ItemTemplate="{StaticResource listviewItem}"
-                              ItemsPanel="{StaticResource listPanel}" Grid.ColumnSpan="2">
-                    </ListView>
+                <Border Visibility="{Binding IsListMode, Converter={StaticResource BoolToVisible}}">
+                    <ListView
+                        x:Name="RecentFilesList"
+                        Grid.ColumnSpan="2"
+                        MinWidth="380"
+                        MinHeight="216"
+                        Margin="32,0,0,0"
+                        Padding="0,0,0,0"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
+                        ItemTemplate="{StaticResource listviewItem}"
+                        ItemsPanel="{StaticResource listPanel}"
+                        ItemsSource="{Binding RecentFilesGroup}"
+                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                        ScrollViewer.VerticalScrollBarVisibility="Auto"
+                        SelectionMode="Extended"
+                        Style="{StaticResource FilesListViewStyle}"
+                        VirtualizingPanel.CacheLength="1"
+                        VirtualizingPanel.CacheLengthUnit="Page"
+                        VirtualizingPanel.IsVirtualizing="True"
+                        VirtualizingPanel.ScrollUnit="Pixel" />
                 </Border>
                 </Border>
 
 
-                <ListView x:Name="GridRecentFilesList"
-                          Visibility="{Binding IsListMode,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                          ItemsSource="{Binding RecentFilesGroup}"
-                          Margin="32,0,0,0"
-                          VirtualizingPanel.IsVirtualizing="True"
-                          VirtualizingPanel.CacheLengthUnit="Page"
-                          VirtualizingPanel.CacheLength="1"
-                          VirtualizingPanel.ScrollUnit="Pixel"
-                          ScrollViewer.HorizontalScrollBarVisibility="Disabled"
-                          ScrollViewer.VerticalScrollBarVisibility="Auto"
-                          Background="Transparent" BorderThickness="0"
-                          Padding="0,0,0,0" MinHeight="216" MinWidth="380"
-                          SelectionMode="Multiple"
-                          ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
-                          Style="{StaticResource FilesGridViewStyle}"
-                          ItemTemplate="{StaticResource gridviewItem}"
-                          ItemsPanel="{StaticResource gridPanel}" Grid.ColumnSpan="2">
-                </ListView>
+                <ListView
+                    x:Name="GridRecentFilesList"
+                    Grid.ColumnSpan="2"
+                    MinWidth="380"
+                    MinHeight="216"
+                    Margin="32,0,0,0"
+                    Padding="0,0,0,0"
+                    Background="Transparent"
+                    BorderThickness="0"
+                    ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
+                    ItemTemplate="{StaticResource gridviewItem}"
+                    ItemsPanel="{StaticResource gridPanel}"
+                    ItemsSource="{Binding RecentFilesGroup}"
+                    ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                    ScrollViewer.VerticalScrollBarVisibility="Auto"
+                    SelectionMode="Extended"
+                    Style="{StaticResource FilesGridViewStyle}"
+                    VirtualizingPanel.CacheLength="1"
+                    VirtualizingPanel.CacheLengthUnit="Page"
+                    VirtualizingPanel.IsVirtualizing="True"
+                    VirtualizingPanel.ScrollUnit="Pixel"
+                    Visibility="{Binding IsListMode, Converter={StaticResource InvertBoolToVisibleConvert}}" />
             </Grid>
             </Grid>
 
 
-            <StackPanel x:Name="BlankContentPanel" Grid.Row="1" Grid.RowSpan="2"  HorizontalAlignment="Center" VerticalAlignment="Center"
-                        Visibility="{Binding IsEmpty,Converter={StaticResource BoolToVisible}}">
+            <StackPanel
+                x:Name="BlankContentPanel"
+                Grid.Row="1"
+                Grid.RowSpan="2"
+                HorizontalAlignment="Center"
+                VerticalAlignment="Center"
+                Visibility="{Binding IsEmpty, Converter={StaticResource BoolToVisible}}">
 
 
 
 
-                <Button x:Name="BtnAddFiles" MaxHeight="128" Width="128" Height="128" Background="Transparent" BorderThickness="0"
-                           
-                            Command="{Binding OpenFilesCommand}" 
-                            Style="{StaticResource OnlyContentBtn}" Foreground="#6B6F7D">
+                <Button
+                    x:Name="BtnAddFiles"
+                    Width="128"
+                    Height="128"
+                    MaxHeight="128"
+                    Background="Transparent"
+                    BorderThickness="0"
+                    Command="{Binding OpenFilesCommand}"
+                    Foreground="#6B6F7D"
+                    Style="{StaticResource OnlyContentBtn}">
                     <Grid Width="128" Height="128">
                     <Grid Width="128" Height="128">
-                        <Image Source="../../../Resources/HomeIcon/add.png" Width="128" Height="128" Stretch="Uniform" VerticalAlignment="Center" />
+                        <Image
+                            Width="128"
+                            Height="128"
+                            VerticalAlignment="Center"
+                            Source="../../../Resources/HomeIcon/add.png"
+                            Stretch="Uniform" />
                     </Grid>
                     </Grid>
                 </Button>
                 </Button>
 
 
-                <TextBlock x:Name="NoFilesText" Text="No documents" TextAlignment="Center"  HorizontalAlignment="Center" FontSize="16" LineHeight="22" Foreground="#FF333333" FontFamily="Segoe UI" />
-                <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
-                    <TextBlock x:Name="clickFileText" Text="Drop documents here or click the '" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14" />
+                <TextBlock
+                    x:Name="NoFilesText"
+                    HorizontalAlignment="Center"
+                    FontFamily="Segoe UI"
+                    FontSize="16"
+                    Foreground="#FF333333"
+                    LineHeight="22"
+                    Text="No documents"
+                    TextAlignment="Center" />
+                <StackPanel Margin="0,12,0,0" Orientation="Horizontal">
+                    <TextBlock
+                        x:Name="clickFileText"
+                        VerticalAlignment="Center"
+                        FontSize="14"
+                        Foreground="#FF999999"
+                        Text="Drop documents here or click the '" />
                 </StackPanel>
                 </StackPanel>
             </StackPanel>
             </StackPanel>
         </Grid>
         </Grid>

+ 5 - 0
PDFSettings/APPSettingProperties.cs

@@ -40,6 +40,11 @@ namespace PDFSettings
         /// </summary>
         /// </summary>
         public int RecentFileListMode = 0;
         public int RecentFileListMode = 0;
 
 
+        /// <summary>
+        /// 删除最近文件记录时是否显示询问弹窗
+        /// </summary>
+        public bool DontTipBeforeDeleteRecent = false;
+
         /// <summary>
         /// <summary>
         /// 切换语言时 重启时需要打开的文档列表
         /// 切换语言时 重启时需要打开的文档列表
         /// </summary>
         /// </summary>