浏览代码

安全 - 延迟删除、删除Tip,阅读页 - file快捷键,

liuaoran 2 年之前
父节点
当前提交
38d9adb1f1

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

@@ -114,7 +114,7 @@ namespace PDF_Office
         /// <summary>
         /// 是否已经登陆
         /// </summary>
-        public static bool IsLogin =false;
+        public static bool IsLogin = true;
 
         //是否需要显示注册弹窗
         //app第一次启动时需要弹出注册弹窗
@@ -385,6 +385,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<FileRestrictedTip>();
             containerRegistry.RegisterForNavigation<LinkAnnotTip>();
             containerRegistry.RegisterForNavigation<ReadModelTip>();
+            containerRegistry.RegisterForNavigation<RemoveSecuritySuccessTip>();
 
             //轻会员
             containerRegistry.RegisterForNavigation<CodeRegion>();

+ 4 - 3
PDF Office/EventAggregators/ShowTipEvent.cs

@@ -11,15 +11,16 @@ namespace PDF_Office.EventAggregators
     {
         StatusNone,
         StatusFileRestricted,
-        StatusSetPasswordSuccessfully
-    }  
+        StatusSetPasswordSuccessfully,
+        StatusRemoveSecuritySuccessfully
+    }
 
     public class ShowTipEventArgs
     {
         public EnumTipKind enumTipKind;
         public string Unicode;
     }
-    public class ShowTipEvent:PubSubEvent<ShowTipEventArgs>
+    public class ShowTipEvent : PubSubEvent<ShowTipEventArgs>
     {
     }
 }

+ 2 - 2
PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/DeleteSafetySettintgsModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit.PDFDocument;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -20,6 +21,5 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
             StatusOpenPassword,
             StatusPermissionsPassword
         }
-
     }
 }

+ 1 - 0
PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogModel.cs

@@ -62,6 +62,7 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
     public class SecurityInfo
     {
         public bool IsPasswordChanged = false;
+        public bool IsPasswordRemoved = false;
         public bool NeedOpenPassword = false;
         public bool NeedPermissionsPassword = false;
         public string OpenPassword = null;

+ 8 - 2
PDF Office/PDF Office.csproj

@@ -515,7 +515,6 @@
     <Compile Include="ViewModels\EditTools\HeaderFooter\HeaderFooterDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\HeaderFooter\HeaderFooterTemplateListContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Redaction\RedactionContentViewModel.cs" />
-    <Compile Include="ViewModels\FileRestrictedTipViewModel.cs" />
     <Compile Include="ViewModels\Form\ButtonPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\CheckBoxPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\ComboxPropertyViewModel.cs" />
@@ -564,9 +563,9 @@
     <Compile Include="ViewModels\Dialog\DynamicPropertyDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\PageContentViewModel.cs" />
     <Compile Include="ViewModels\Scan\ScanViwerViewModel.cs" />
-    <Compile Include="ViewModels\SetPasswordSuccessfullyTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\FileRestrictedTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\LinkAnnotTipViewModel.cs" />
+    <Compile Include="ViewModels\TipContent\RemoveSecuritySuccessTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\SetPasswordSuccessfullyTipViewModel.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Command.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Layout.cs" />
@@ -1175,6 +1174,9 @@
     <Compile Include="Views\TipContent\ReadModelTip.xaml.cs">
       <DependentUpon>ReadModelTip.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\TipContent\RemoveSecuritySuccessTip.xaml.cs">
+      <DependentUpon>RemoveSecuritySuccessTip.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\TipContent\SetPasswordSuccessfullyTip.xaml.cs">
       <DependentUpon>SetPasswordSuccessfullyTip.xaml</DependentUpon>
     </Compile>
@@ -2115,6 +2117,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\TipContent\RemoveSecuritySuccessTip.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\TipContent\SetPasswordSuccessfullyTip.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 60 - 35
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/DeleteSafetySettingsDialogViewModel.cs

@@ -9,6 +9,8 @@ using Prism.Services.Dialogs;
 using System;
 using System.Windows.Forms;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
+using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.SetPasswordDialogModel;
+
 
 namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
 {
@@ -38,6 +40,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             }
         }
 
+        private ViewContentViewModel viewContentViewModel;
 
         private void InitString()
         {
@@ -108,14 +111,58 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             }
             catch
             {
-                return EnumNeedPassword.StatusCannotDecrypt;
+                return DeleteSafetySettintgsModel.EnumNeedPassword.StatusCannotDecrypt;
             }
         }
         #endregion
 
         #region 逻辑函数
+        ///// <summary>
+        ///// 逻辑优化:判权操作放到密码弹窗里,所以一旦进入该状态,可以直接清除权限
+        ///// </summary>
+        //public void RemoveSecuritySettings()
+        //{
+        //    //付费锁
+        //    //if (!App.IsLogin)
+        //    //{
+        //    //    dialogs.ShowDialog(DialogNames.IAPCompareDialog);
+        //    //    return;
+        //    //}
+        //    System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+        //    /*
+        //     *设置这个对话框的起始保存路径
+        //     */
+        //    sfd.InitialDirectory = document.FilePath;
+        //    /*
+        //     *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+        //     */
+        //    sfd.Filter = "PDF|*.pdf;";
+        //    /*
+        //     *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+        //     */
+        //    sfd.FileName = document.FileName + "_DecryptedFile.pdf";
+        //    /*
+        //     * 做一些工作
+        //     */
+        //    if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+        //    {
+        //        if(document.Descrypt(sfd.FileName)){
+        //            MessageBoxEx.Show("保存成功");
+        //            RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
+        //        }
+        //        else
+        //        {
+        //            ///TODO 不明原因干扰
+        //        } 
+        //    }
+        //    else
+        //    {
+        //        MessageBox.Show("取消保存");
+        //    }
+        //}
+
         /// <summary>
-        /// 逻辑优化:判权操作放到密码弹窗里,所以一旦进入该状态,可以直接清除权限
+        /// 去除安全性设置2.0
         /// </summary>
         public void RemoveSecuritySettings()
         {
@@ -125,43 +172,20 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
                 dialogs.ShowDialog(DialogNames.IAPCompareDialog);
                 return;
             }
-            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
-            /*
-             *设置这个对话框的起始保存路径
-             */
-            sfd.InitialDirectory = document.FilePath;
-            /*
-             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
-             */
-            sfd.Filter = "PDF|*.pdf;";
-            /*
-             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
-             */
-            sfd.FileName = document.FileName + "_DecryptedFile.pdf";
-            /*
-             * 做一些工作
-             */
-            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
-            {
-                if(document.Descrypt(sfd.FileName)){
-                    MessageBoxEx.Show("保存成功");
-                    RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
-                }
-                else
-                {
-                    ///TODO 不明原因干扰
-                } 
-            }
-            else
-            {
-                MessageBox.Show("取消保存");
-            }
+
+            viewContentViewModel.SecurityInfo.NeedOpenPassword = false;
+            viewContentViewModel.SecurityInfo.NeedPermissionsPassword = false;
+            viewContentViewModel.SecurityInfo.OpenPassword = null;
+            viewContentViewModel.SecurityInfo.PermissionsPassword = null;
+            viewContentViewModel.SecurityInfo.CPDFPermissionsInfo = CreateDefaultPermissionsInfo();
+            viewContentViewModel.SecurityInfo.IsPasswordRemoved = true;
+            viewContentViewModel.SecurityInfo.IsPasswordChanged = false;
+            RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
         }
-         
+
         private void Cancel()
         {
             RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
-
         }
         #endregion
 
@@ -183,6 +207,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
         {
             CPDFDocument doc = null;
             parameters.TryGetValue<CPDFDocument>(ParameterNames.PDFDocument, out doc);
+            parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             if (doc != null)
             {
                 document = doc;

+ 2 - 0
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs

@@ -435,6 +435,8 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             if (haveViewModel)
             {
                 viewContentViewModel.SecurityInfo.IsPasswordChanged = true;
+                viewContentViewModel.SecurityInfo.IsPasswordRemoved= false;
+
                 if (NeedOpenPassword && (!string.IsNullOrEmpty(OpenPassword)))
                 {
                     this.viewContentViewModel.SecurityInfo.NeedOpenPassword = true;

+ 0 - 16
PDF Office/ViewModels/FileRestrictedTipViewModel.cs

@@ -1,16 +0,0 @@
-using Prism.Commands;
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace PDF_Office.ViewModels
-{
-    public class FileRestrictedTipViewModel : BindableBase
-    {
-        public FileRestrictedTipViewModel()
-        {
-
-        }
-    }
-}

+ 3 - 2
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -104,6 +104,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         private IDialogService dialogs;
         #endregion
         string Unicode = "";
+        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events) { }
 
         public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events,IDialogService dialogService)
         {
@@ -388,8 +389,8 @@ namespace PDF_Office.ViewModels.FillAndSign
             return Annot;
         }
         private void CheckedEvent(object e)
-        {
-
+        {
+
             var control = e as Control;
         
             IsEdit = false;

+ 0 - 16
PDF Office/ViewModels/SetPasswordSuccessfullyTipViewModel.cs

@@ -1,16 +0,0 @@
-using Prism.Commands;
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace PDF_Office.ViewModels
-{
-    public class SetPasswordSuccessfullyTipViewModel : BindableBase
-    {
-        public SetPasswordSuccessfullyTipViewModel()
-        {
-
-        }
-    }
-}

+ 30 - 0
PDF Office/ViewModels/TipContent/RemoveSecuritySuccessTipViewModel.cs

@@ -0,0 +1,30 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.TipContent
+{
+    public class RemoveSecuritySuccessTipViewModel : BindableBase,INavigationAware
+    {
+        public RemoveSecuritySuccessTipViewModel()
+        {
+
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 41 - 30
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -201,45 +201,45 @@ namespace PDF_Office.ViewModels.Tools
         }
 
         private void OpenSetPasswordDialog()
-        {
-            if (!viewContentViewModel.SecurityInfo.IsPasswordChanged)
+        { 
+            VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
+            if (result.IsDiscryptied)
             {
-                VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
-                if (result.IsDiscryptied)
-                {
-
-                    if (result.Password != null)
-                    {
-                        string filePath = PDFViewer.Document.FilePath;
-                        PDFViewer.Document.Release();
-                        PDFViewer.InitDocument(filePath);
-                        PDFViewer.Load();
-                        PDFViewer.Document.UnlockWithPassword(result.Password);
-                    }
 
+                if (result.Password != null || !viewContentViewModel.SecurityInfo.IsPasswordChanged)
+                {
+                    string filePath = PDFViewer.Document.FilePath;
+                    PDFViewer.CloseDocument();
+                    PDFViewer.InitDocument(filePath);
+                    PDFViewer.Load();
+                    PDFViewer.Document.UnlockWithPassword(result.Password);
+                }
 
-                    DialogParameters value = new DialogParameters();
-                    value.Add(ParameterNames.PDFViewer, this.PDFViewer);
-                    value.Add(ParameterNames.ViewContentViewModel, this.viewContentViewModel);
-                    dialogs.ShowDialog(DialogNames.SetPasswordDialog, value, e =>
+                DialogParameters value = new DialogParameters();
+                value.Add(ParameterNames.PDFViewer, this.PDFViewer);
+                value.Add(ParameterNames.ViewContentViewModel, this.viewContentViewModel);
+                dialogs.ShowDialog(DialogNames.SetPasswordDialog, value, e =>
+                {
+                    if (e.Result == ButtonResult.OK)
                     {
-                        if (e.Result == ButtonResult.OK)
+                        SecurityHelper.IsPasswordChanged = true;
+                        if (viewContentViewModel.SecurityInfo.IsPasswordChanged)
                         {
-                            SecurityHelper.IsPasswordChanged = true;
-                            if (viewContentViewModel.SecurityInfo.IsPasswordChanged)
-                            {
-                                viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
-                            }
-                            this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully, Unicode = unicode });
+                            viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
                         }
-                    });
-                }
-            }
+                        this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully, Unicode = unicode });
+                    }
+                });
+            } 
         }
 
         private void OpenCancelPasswordDialog()
         {
-            if (!PDFViewer.Document.IsEncrypted)
+            ///无可用安全性设置的原因:
+            ///文件本身无安全性设置,且没有设置过密码
+            ///文件安全性已经被重置
+            ///
+            if ((!PDFViewer.Document.IsEncrypted && !viewContentViewModel.SecurityInfo.IsPasswordChanged) || (viewContentViewModel.SecurityInfo.IsPasswordRemoved))
             {
                 MessageBoxEx.Show("No security settings available ");
             }
@@ -257,7 +257,18 @@ namespace PDF_Office.ViewModels.Tools
                     }
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.PDFDocument, PDFViewer.Document);
-                    dialogs.ShowDialog(DialogNames.DeleteSafetySettingsDialog, value, e => { });
+                    value.Add(ParameterNames.ViewContentViewModel, this.viewContentViewModel);
+                    dialogs.ShowDialog(DialogNames.DeleteSafetySettingsDialog, value, e =>
+                    {
+                        if (e.Result == ButtonResult.OK)
+                        {
+                            if (viewContentViewModel.SecurityInfo.IsPasswordRemoved)
+                            {
+                                viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
+                            }
+                            this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusRemoveSecuritySuccessfully, Unicode = unicode });
+                        }
+                    });
                 }
             }
         }

+ 33 - 7
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -246,7 +246,7 @@ namespace PDF_Office.ViewModels
 
         public string BackgroundContentRegionName { get; set; }
         //若point不赋值或从列表中找不到point,系统会提供默认值为(0,0)的新point,所以改用Tuple<int,int>
-        public List<Tuple<int,int>> FillAndSign = new List<Tuple<int, int>>();
+        public List<Tuple<int, int>> FillAndSign = new List<Tuple<int, int>>();
 
         /// <summary>
         /// 文档的密码
@@ -802,7 +802,7 @@ namespace PDF_Office.ViewModels
 
             eventAggregator.GetEvent<EnterSelectedEditToolEvent>().Subscribe(EnterEditTools, e => e.Unicode == unicode);
             eventAggregator.GetEvent<CloseEditToolEvent>().Subscribe(CloseEditTool, e => e.Unicode == unicode);
-            eventAggregator.GetEvent<ShowTipEvent>().Subscribe(ShowSelectedTip, e => e.Unicode == unicode);
+            eventAggregator.GetEvent<ShowTipEvent>().Subscribe(ShowSelectedTipAsync, e => e.Unicode == unicode);
 
             //TODO:根据缓存 选择用户上次选择的菜单
             EnterSelectedBar("TabItemAnnotation");
@@ -1157,7 +1157,7 @@ namespace PDF_Office.ViewModels
             }
         }
 
-        public void ShowSelectedTip(ShowTipEventArgs showTipEventArgs)
+        public async void ShowSelectedTipAsync(ShowTipEventArgs showTipEventArgs)
         {
             switch (showTipEventArgs.enumTipKind)
             {
@@ -1169,7 +1169,16 @@ namespace PDF_Office.ViewModels
                     ShowLeftTip(true);
                     region.RequestNavigate(LeftTipContentRegionName, "SetPasswordSuccessfullyTip");
                     break;
+                case EnumTipKind.StatusRemoveSecuritySuccessfully:
+                    ShowLeftTip(false);
+                    region.RequestNavigate(TipContentRegionName, "RemoveSecuritySuccessTip");
+                    IsLoading = Visibility.Collapsed;
 
+                    ShowTip(true);
+                    await Task.Delay(3000);
+                    //ReadModelTip = Visibility.Collapsed;
+                    TipVisible = Visibility.Collapsed;
+                    break;
                 default: break;
             }
         }
@@ -1238,7 +1247,7 @@ namespace PDF_Office.ViewModels
         private void SettingsEvent()
         {
             dialogs.ShowDialog(DialogNames.SettingsDialog, null, null);
-            if(PDFViewer!=null)
+            if (PDFViewer != null)
             {
                 PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
             }
@@ -1817,7 +1826,7 @@ namespace PDF_Office.ViewModels
         {
             OpenFileInfo = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);
             //偏好设置里设置了记录上次视图设置时
-            if (OpenFileInfo != null&&Settings.Default.AppProperties.Description.RecoveryViewWhenOpen)
+            if (OpenFileInfo != null && Settings.Default.AppProperties.Description.RecoveryViewWhenOpen)
             {
                 if (OpenFileInfo.LastViewMode != PDFViewer.ModeView)
                 {
@@ -1913,8 +1922,6 @@ namespace PDF_Office.ViewModels
                 //Security Fixed:
                 //修改密码后原文档保存的步骤:
                 //在设置密码窗口传出“已修改”信号,并允许延迟保存
-                //延迟保存方式:
-                //
                 //
                 if (SecurityInfo.IsPasswordChanged)
                 {
@@ -1982,6 +1989,25 @@ namespace PDF_Office.ViewModels
                         return false;
                     }
                 }
+                else if (SecurityInfo.IsPasswordRemoved)
+                {
+                    try
+                    {
+                        string currentPath = PDFViewer.Document.FilePath;
+                        string tempPath = PDFViewer.Document.FilePath + ".temp.pdf";
+                        PDFViewer.Document.Descrypt(tempPath);
+                        PDFViewer.CloseDocument();
+                        PDFViewer.InitDocument(tempPath);
+                        PDFViewer.Document.WriteToFilePath(currentPath);
+                        PDFViewer.CloseDocument();
+                        PDFViewer.InitDocument(currentPath);
+                        PDFViewer.Load();
+                    }
+                    catch
+                    {
+                        return false;
+                    }
+                }
 
                 bool result = PDFViewer.Document.WriteToLoadedPath();
                 if (result)

+ 1 - 1
PDF Office/Views/TipContent/ReadModelTip.xaml

@@ -23,7 +23,7 @@
                 Padding="11"
                 Foreground="#FFFFFFFF"
                 Text="{x:Static mainpage:MainPage.GlobalTip_ExitReadMode}"
-                TextAlignment="Center" />
+                TextAlignment="Center" HorizontalAlignment="Left" Width="145" />
         </Border>
     </Grid>
 </UserControl>

+ 25 - 0
PDF Office/Views/TipContent/RemoveSecuritySuccessTip.xaml

@@ -0,0 +1,25 @@
+<UserControl x:Class="PDF_Office.Views.TipContent.RemoveSecuritySuccessTip"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" >
+    <Grid>
+        <Border Height="40" Width="279" CornerRadius="4" Background="{StaticResource color.sys.layout.dark.bg}" BorderThickness="1">
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="40"></ColumnDefinition>
+                    <ColumnDefinition></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0" Margin="16,12,8,12" HorizontalAlignment="Center" VerticalAlignment="Center" Height="16" Width=" 16">
+                    <Ellipse Width="14" Height="14" Fill="#1AD598">
+                    </Ellipse>
+                    <Path Data="M12.5912 5.46115L7.907 11.4611C7.77258 11.6333 7.5698 11.7383 7.35162 11.7488C7.13345 11.7592 6.92157 11.674 6.77136 11.5154L3.45557 8.01543L4.5445 6.98381L7.26093 9.85116L11.4089 4.53809L12.5912 5.46115Z" Fill="White"></Path>
+                </Grid>
+                <Grid VerticalAlignment="Center" Grid.Column="1" Height="22">
+                    <TextBlock Text="Successfully delete security settings." VerticalAlignment="Center" FontFamily="Segoe UI" Foreground="{StaticResource color.sys.text.anti.norm}"></TextBlock>
+                </Grid>
+            </Grid>
+        </Border>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/TipContent/RemoveSecuritySuccessTip.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.TipContent
+{
+    /// <summary>
+    /// Interaction logic for RemoveSecuritySuccessTip
+    /// </summary>
+    public partial class RemoveSecuritySuccessTip : UserControl
+    {
+        public RemoveSecuritySuccessTip()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 7 - 0
PDF Office/Views/ViewContent.xaml

@@ -50,6 +50,13 @@
     <UserControl.InputBindings>
         <KeyBinding Command="{StaticResource CloseLeft}" Modifiers="Ctrl" Key="F4" />
         <KeyBinding Command="{StaticResource CloseRight}" Modifiers="Ctrl+Shift" Key="F4" />
+        <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O"></KeyBinding>
+        <KeyBinding Command="{Binding mainViewModel.mainWindowViewModel.AddTab}" Gesture="Ctrl+T"></KeyBinding>
+        <KeyBinding Command="{Binding SaveFile}" Gesture="Ctrl+S"></KeyBinding>
+        <KeyBinding Command="{Binding SaveAsFile}" Gesture="Ctrl+Shift+S"></KeyBinding>
+        <KeyBinding Command="{Binding CloseWindowCommand}" Gesture="Ctrl+Shift+W"></KeyBinding>
+        <KeyBinding Command="{Binding mainViewModel.CloseTab}" Gesture="Ctrl+W"></KeyBinding>
+        <KeyBinding Command="{Binding SettingsCommand}" Gesture="Ctrl+P"></KeyBinding>
     </UserControl.InputBindings>
 
     <UserControl.CommandBindings>