Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

zhuyi 2 years ago
parent
commit
bfc412c7e0

+ 3 - 0
PDF Office/App.config

@@ -33,6 +33,9 @@
       <setting name="UpdateSettings" serializeAs="String">
         <value>True</value>
       </setting>
+      <setting name="IsNewUser" serializeAs="String">
+        <value>True</value>
+      </setting>
     </PDF_Office.Properties.Settings>
   </userSettings>
 </configuration>

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

@@ -75,6 +75,7 @@ namespace PDF_Office
         /// 产品名称
         /// </summary>
         public static string Name = "PDF Office";
+
         /// <summary>
         /// 当前app版本号
         /// </summary>
@@ -137,7 +138,6 @@ namespace PDF_Office
                 //重置用于弹窗的记录参数
             }
 
-
             if (Settings.Default.RecentOpenFiles == null)
                 Settings.Default.RecentOpenFiles = new RecentOpenFiles();
 
@@ -360,7 +360,8 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<NOInternetRegion>();
             containerRegistry.RegisterForNavigation<UserOutCodeRegion>();
             containerRegistry.RegisterForNavigation<PasswordUpdataRegion>();
-           
+
+            containerRegistry.RegisterForNavigation<StickyNotePopup>();
 
             #endregion 注册内容组件
 
@@ -416,6 +417,8 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<LoginDialog>(DialogNames.LoginDialog);
             containerRegistry.RegisterDialog<UserDialog>(DialogNames.UserDialog);
 
+            //新手引导弹窗
+            containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
             #endregion 注册弹窗
         }
 

+ 47 - 0
PDF Office/Model/Dialog/GuidItemModel.cs

@@ -0,0 +1,47 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog
+{
+    public class GuidItemModel:BindableBase
+    {
+        private string title;
+
+        public string Title
+        {
+            get { return title; }
+            set
+            {
+                SetProperty(ref title, value);
+            }
+        }
+
+        private string content;
+        /// <summary>
+        /// 文案内容
+        /// </summary>
+        public string Content
+        {
+            get { return content; }
+            set
+            {
+                SetProperty(ref content, value);
+            }
+        }
+
+        private string imageSource;
+        //图片路径
+        public string ImageSource
+        {
+            get { return imageSource; }
+            set
+            {
+                SetProperty(ref imageSource, value);
+            }
+        }
+    }
+}

+ 5 - 1
PDF Office/Model/DialogNames.cs

@@ -11,6 +11,11 @@ namespace PDF_Office.Model
     /// </summary>
     public static class DialogNames
     {
+        /// <summary>
+        /// 新手引导弹窗
+        /// </summary>
+        public static string GuidDialog = "GuidDialog";
+
         /// <summary>
         /// 注册弹窗
         /// </summary>
@@ -26,7 +31,6 @@ namespace PDF_Office.Model
         /// </summary>
         public static string UserDialog = "UserDialog";
 
-
         /// <summary>
         /// 文档属性
         /// </summary>

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

@@ -77,6 +77,9 @@ namespace PDF_Office.Model
         public static string AnnotationColors = "AnnotationColors";
         public static string AnnotationAuthor = "AnnotationAuthor";
         public static string AnnotationCleanState = "AnnotationCleanState";
+
+        public static string StickyAnnotArgs = "StickyAnnotArgs";
+
         /// <summary>
         /// 底部工具栏
         /// </summary>
@@ -106,6 +109,7 @@ namespace PDF_Office.Model
         /// 打印
         /// </summary>
         public static string PrintQueue = "PrintQueue";
+
         public static string PrintSettingsInfo = "PrintSettingsInfo";
         public static string PrintCurrentPage = "PrintCurrentPage";
 
@@ -113,6 +117,7 @@ namespace PDF_Office.Model
         /// 密码
         /// </summary>
         public static string PasswordKind = "PasswordKind";
+
         public static string PasswordResult = "PasswordResult";
         public static string Password = "Password";
     }

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

@@ -69,6 +69,13 @@ namespace PDF_Office.Model
                 return GetRegionName("LeftTipContentRegionName");
             }
         }
+        public static string NotePopupRegionName
+        {
+            get
+            {
+                return GetRegionName("NotePopupRegionName");
+            }
+        }
 
         public static string ReadRegionName
         {

+ 25 - 0
PDF Office/PDF Office.csproj

@@ -377,6 +377,7 @@
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterRTFDialogModel.cs" />
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterTextDialogModel.cs" />
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterWordDialogModel.cs" />
+    <Compile Include="Model\Dialog\GuidItemModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSVModel.cs" />
@@ -448,6 +449,7 @@
     </Compile>
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromScannerDialogsViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\NoviceGuidDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\PropertiesDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\MarkSettingDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\PageMarkDialogViewModel.cs" />
@@ -545,6 +547,7 @@
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\Dialog\SignatureCreateDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SnapshotEditMenuViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\StickyNotePopupViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\StickyNotePropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageTextEditPropertyViewModel.cs" />
@@ -815,6 +818,9 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageSplitDialog.xaml.cs">
       <DependentUpon>HomePageSplitDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\NoviceGuidDialog.xaml.cs">
+      <DependentUpon>NoviceGuidDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\PageEditDialogs\ExtractDialog.xaml.cs">
       <DependentUpon>ExtractDialog.xaml</DependentUpon>
     </Compile>
@@ -1555,6 +1561,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\NoviceGuidDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\PageEditDialogs\SplitDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -2158,6 +2168,21 @@
     <Resource Include="Resources\Dialog\password.png" />
     <Resource Include="Resources\BOTA\no search.png" />
     <Resource Include="Resources\Dialog\helphover.png" />
+    <Content Include="Resources\GuidItems\Guid_Annote.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_Convert.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_FillAndSign.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_Office.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_SignUp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Content Include="source\AnalysisWord\Res\word\_rels\document.xml.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

+ 13 - 1
PDF Office/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace PDF_Office.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -236,5 +236,17 @@ namespace PDF_Office.Properties {
                 this["ColorSelectors"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        public bool IsNewUser {
+            get {
+                return ((bool)(this["IsNewUser"]));
+            }
+            set {
+                this["IsNewUser"] = value;
+            }
+        }
     }
 }

+ 3 - 0
PDF Office/Properties/Settings.settings

@@ -59,5 +59,8 @@
     <Setting Name="ColorSelectors" Type="PDFSettings.ColorSelectorList" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
+    <Setting Name="IsNewUser" Type="System.Boolean" Scope="User">
+      <Value Profile="(Default)">True</Value>
+    </Setting>
   </Settings>
 </SettingsFile>

BIN
PDF Office/Resources/GuidItems/Guid_Annote.png


BIN
PDF Office/Resources/GuidItems/Guid_Convert.png


BIN
PDF Office/Resources/GuidItems/Guid_FillAndSign.png


BIN
PDF Office/Resources/GuidItems/Guid_Office.png


BIN
PDF Office/Resources/GuidItems/Guid_SignUp.png


+ 3 - 0
PDF Office/Styles/ButtonStyle.xaml

@@ -495,12 +495,15 @@
         <Style.Triggers>
             <Trigger Property="IsMouseOver" Value="true">
                 <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.hov}" />
+                <Setter Property="Background" Value="Transparent" />
             </Trigger>
             <Trigger Property="IsPressed" Value="true">
                 <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.act}" />
+                <Setter Property="Background" Value="Transparent" />
             </Trigger>
             <Trigger Property="IsEnabled" Value="false">
                 <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.dis}" />
+                <Setter Property="Background" Value="Transparent" />
             </Trigger>
         </Style.Triggers>
     </Style>

+ 188 - 0
PDF Office/ViewModels/Dialog/NoviceGuidDialogViewModel.cs

@@ -0,0 +1,188 @@
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PDF_Office.ViewModels.Dialog
+{
+    public class NoviceGuidDialogViewModel :BindableBase,IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        private int selectedIndex;
+
+        /// <summary>
+        /// 选中索引
+        /// </summary>
+        public int SelectedIndex
+        {
+            get { return selectedIndex; }
+            set
+            {
+                SetProperty(ref selectedIndex, value);
+
+                if(SelectedIndex==ItemSource.Count-1)
+                {
+                    SignUpVisible = Visibility.Visible;
+                }
+                else
+                {
+                    SignUpVisible = Visibility.Collapsed;
+                }
+
+                if(SelectedIndex==0)
+                {
+                    NextTimeVisible = Visibility.Visible;
+                }
+                else
+                {
+                    NextTimeVisible = Visibility.Collapsed;
+                }
+            }
+        }
+
+        private Visibility signUpVisible = Visibility.Collapsed;
+
+        /// <summary>
+        /// 是否显示SignUp按钮
+        /// </summary>
+        public Visibility SignUpVisible
+        {
+            get { return signUpVisible; }
+            set
+            {
+                SetProperty(ref signUpVisible, value);
+            }
+        }   
+
+        private Visibility nexttimeVisible;
+
+        public Visibility NextTimeVisible
+        {
+            get { return nexttimeVisible; }
+            set
+            {
+                SetProperty(ref nexttimeVisible, value);
+            }
+        }
+
+
+
+        public DelegateCommand NextPageCommand { get; set; }
+
+        public DelegateCommand PrePageCommand { get; set; }
+
+        public DelegateCommand NextTimeCommand { get; set; }
+
+        public DelegateCommand SignUpCommand { get; set; }
+
+        public ObservableCollection<GuidItemModel> ItemSource { get; set; }
+
+        private IDialogService dialog;
+
+        public NoviceGuidDialogViewModel(IDialogService dialogService)
+        {
+            dialog = dialogService;
+
+            NextPageCommand = new DelegateCommand(NextPage,CanNextPageExcute).ObservesProperty(()=>SelectedIndex);
+            PrePageCommand = new DelegateCommand(PrePage,CanPrePageExcute).ObservesProperty(()=>SelectedIndex);
+            SignUpCommand = new DelegateCommand(SignUp);
+
+            InitItemSource();
+        }
+
+        private void InitItemSource()
+        {
+            ItemSource = new ObservableCollection<GuidItemModel>();
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_Office.png", Title = "PDF Office 全新体验版", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_Annote.png", Title = "强大的PDF注释工具", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_Convert.png", Title = "将PDF转换为可编辑Office", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_FillAndSign.png", Title = "填写表格,签署商务文件", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_SignUp.png", Title = "注册账号享受全功能", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+        }
+
+        /// <summary>
+        /// 前一页
+        /// </summary>
+        private void NextPage()
+        {
+            SelectedIndex++;
+        }
+
+        /// <summary>
+        /// 下一页
+        /// </summary>
+        private void PrePage()
+        {
+            SelectedIndex--;
+        }
+
+        /// <summary>
+        /// 注册
+        /// </summary>
+        private void SignUp()
+        {
+            RequestClose.Invoke(new DialogResult());
+            dialog.ShowDialog(DialogNames.RegisterDialog);
+        }
+
+        /// <summary>
+        /// 下一次显示
+        /// </summary>
+        private void NextTime()
+        {
+            //Todo
+        }
+
+
+        //是否可以执行下一页
+        private bool CanNextPageExcute()
+        {
+            if(SelectedIndex>=ItemSource.Count-1)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// 是否可以执行上一页
+        /// </summary>
+        /// <returns></returns>
+        private bool CanPrePageExcute()
+        {
+            if (SelectedIndex <= 0)
+            {
+                return false;
+            }
+            return true;
+        }
+
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+          
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+           
+        }
+    }
+}

+ 26 - 4
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -221,11 +221,24 @@ namespace PDF_Office.ViewModels
                 System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                 {
                     region.RequestNavigate(RegionNames.MainRegion, "MainContent");
-                    if (App.IsShowRegist)
+
+                    try
                     {
-                        OpenRegister();
+                        //避免注册弹窗和新手引导弹窗一起弹出
+                        if (App.IsShowRegist && !Settings.Default.IsNewUser)
+                        {
+                            OpenRegister();
+                        }
+
+                        //新用户弹出引导弹窗
+                        if (Settings.Default.IsNewUser)
+                        {
+                            ShowGuidDialog();
+                            Settings.Default.IsNewUser = false;
+                            Settings.Default.Save();
+                        }
                     }
-
+                    catch { }
                 }
                 ));
                 App.IsFirstOpen = false;
@@ -237,11 +250,20 @@ namespace PDF_Office.ViewModels
                 {
                     LoginVis = Visibility.Visible;
                 }
-               
+
+
             }
             
         }
 
+        //显示新手引导弹窗
+        private void ShowGuidDialog()
+        {
+            dialogs.ShowDialog(DialogNames.GuidDialog, null, r =>
+            {
+            });
+        }
+
         //打开注册弹窗
         public void OpenRegister()
         {

+ 13 - 6
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -33,6 +33,7 @@ using System.Windows.Input;
 using Prism.Events;
 using Prism.Services.Dialogs;
 using PDF_Office.Views.BOTA;
+using ImTools;
 
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 {
@@ -746,14 +747,20 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             if (region.Regions.ContainsRegionWithName(viewContentViewModel.TipContentRegionName))
             {
                 var views = region.Regions[viewContentViewModel.TipContentRegionName].Views;
-                foreach (var item in views)
+
+                var isHas = views.FindFirst(q => q is Views.TipContent.LinkAnnotTip);
+                if (isHas != null)
                 {
-                    if (item is Views.TipContent.LinkAnnotTip linkAnnotTip)
-                    {
-                        isExist = true;
-                        break;
-                    }
+
                 }
+                //foreach (var item in views)
+                //{
+                //    if (item is Views.TipContent.LinkAnnotTip linkAnnotTip)
+                //    {
+                //        isExist = true;
+                //        break;
+                //    }
+                //}
             }
             if (isExist == false)
             {

+ 79 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePopupViewModel.cs

@@ -0,0 +1,79 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model;
+using PDF_Office.Properties;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
+{
+    internal class StickyNotePopupViewModel : BindableBase, INavigationAware
+    {
+        private string authorText;
+
+        public string AuthorText
+        {
+            get { return authorText; }
+            set
+            {
+                SetProperty(ref authorText, value);
+            }
+        }
+
+        private string dateText;
+
+        public string DateText
+        {
+            get { return dateText; }
+            set
+            {
+                SetProperty(ref dateText, value);
+            }
+        }
+
+        private string contentText;
+
+        public string ContentText
+        {
+            get { return contentText; }
+            set
+            {
+                SetProperty(ref contentText, value);
+            }
+        }
+
+        private ViewContentViewModel ViewContentViewModel;
+        public DelegateCommand ContentTextLostFocus { get; set; }
+
+        public StickyNotePopupViewModel()
+        {
+            ContentTextLostFocus = new DelegateCommand(ContentText_LostFocus);
+        }
+
+        private void ContentText_LostFocus()
+        {
+            ViewContentViewModel.IsNoteAdd = false;
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out ViewContentViewModel);
+            AuthorText = Settings.Default.AppProperties.Description.Author;
+            DateText = DateTime.Now.ToString(@"yyyyMMddHHmmsszzz\'").Replace(':', '\'') + "\n";
+        }
+    }
+}

+ 19 - 6
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -1083,18 +1083,31 @@ namespace PDF_Office.ViewModels.Tools
 
                         stickyAnnotArgs.ClientRect = new Rect(textSelectNodes[0].StartPoint.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
                         stickyAnnotArgs.StickyNote = annotCommand.Text;
-                        PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
+                        //PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
 
-                        customStickyPopup = new StickyNotePopup();
-                        PDFViewer.SetStickyNotePop(customStickyPopup);
+                        NavigationParameters param = new NavigationParameters();
+                        param.Add(ParameterNames.PDFViewer, PDFViewer);
+                        param.Add(ParameterNames.StickyAnnotArgs, stickyAnnotArgs);
+                        param.Add(ParameterNames.ViewContentViewModel, viewContentViewModel);
+
+                        viewContentViewModel.NotePopupVisible = Visibility.Visible;
+                        viewContentViewModel.CanvasNoteLeft = annotCommand.TextRect.X;
+                        viewContentViewModel.CanvasNoteTop = annotCommand.TextRect.Y;
+                        viewContentViewModel.IsNoteAdd = true;
+                        region.RequestNavigate(viewContentViewModel.NotePopupRegionName, "StickyNotePopup", param);
+                        //customStickyPopup.SetAuthor(Settings.Default.AppProperties.Description.Author);
+                        //customStickyPopup.SetDateText(DateTime.Now.ToString(@"yyyyMMddHHmmsszzz\'").Replace(':', '\''));
+
+                        //customStickyPopup = new StickyNotePopup();
+                        //PDFViewer.SetStickyNotePop(customStickyPopup);
 
                         //customStickyPopup.GetCurrentAnnot = stickyAnnotArgs;
                         //customStickyPopup.GetPDFViewer = PDFViewer;
                         //stickyAnnotArgs.Author = Settings.Default.AppProperties.Description.Author;
-                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
-                        PDFViewer.SetToolParam(stickyAnnotArgs);
+                        //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        //PDFViewer.SetToolParam(stickyAnnotArgs);
 
-                        PDFViewer.SetMouseMode(MouseModes.PanTool);
+                        //PDFViewer.SetMouseMode(MouseModes.PanTool);
                         break;
 
                     case "Rect"://矩形

+ 44 - 5
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -230,6 +230,9 @@ namespace PDF_Office.ViewModels
 
         public string LeftTipContentRegionName { get; set; }
 
+        //便签弹窗
+        public string NotePopupRegionName { get; set; }
+
         public string ReadModeRegionName { get; set; }
 
         public string ConverterBarContentRegionName { get; set; }
@@ -270,14 +273,37 @@ namespace PDF_Office.ViewModels
             }
         }
 
-        private Visibility readModelTip = Visibility.Collapsed;
+        private Visibility notePopupVisible = Visibility.Collapsed;
+
+        public Visibility NotePopupVisible
+        {
+            get { return notePopupVisible; }
+            set
+            {
+                SetProperty(ref notePopupVisible, value);
+            }
+        }
+
+        public bool IsNoteAdd = false;
+        private double canvasNoteLeft;
+
+        public double CanvasNoteLeft
+        {
+            get { return canvasNoteLeft; }
+            set
+            {
+                SetProperty(ref canvasNoteLeft, value);
+            }
+        }
+
+        private double canvasNoteTop;
 
-        public Visibility ReadModelTip
+        public double CanvasNoteTop
         {
-            get { return readModelTip; }
+            get { return canvasNoteTop; }
             set
             {
-                SetProperty(ref readModelTip, value);
+                SetProperty(ref canvasNoteTop, value);
             }
         }
 
@@ -646,6 +672,7 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand Load { get; set; }
 
+        public DelegateCommand MouseDown { get; set; }
         public DelegateCommand<object> TabControlSelectionChangedCommand { get; set; }
 
         public DelegateCommand SaveFile { get; set; }
@@ -700,6 +727,7 @@ namespace PDF_Office.ViewModels
             unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             LoadFile = new DelegateCommand(loadFile);
             Load = new DelegateCommand(LoadControl);
+            MouseDown = new DelegateCommand(MouseDownEvent);
             SaveFile = new DelegateCommand(() => { saveFile(); }, CanSaveExcute).ObservesProperty(() => CanSave);
             SaveAsFlattenCommand = new DelegateCommand(saveAsFlatten);
             SaveAsFile = new DelegateCommand(() => { saveAsFile(); });
@@ -739,6 +767,7 @@ namespace PDF_Office.ViewModels
             TipVisible = Visibility.Visible;
             TipContentRegionName = RegionNames.TipContentRegionName;
             LeftTipContentRegionName = RegionNames.LeftTipContentRegionName;
+            NotePopupRegionName = RegionNames.NotePopupRegionName;
             OCRViewerRegionName = RegionNames.OCRViewerRegionName;
             ToolContentRegionName = Guid.NewGuid().ToString();
             ToolsBarContentRegionName = Guid.NewGuid().ToString();
@@ -762,6 +791,14 @@ namespace PDF_Office.ViewModels
             EnterSelectedBar("TabItemAnnotation");
         }
 
+        private void MouseDownEvent()
+        {
+            if (NotePopupVisible == Visibility.Visible && IsNoteAdd == false)
+            {
+                NotePopupVisible = Visibility.Collapsed;
+            }
+        }
+
         /// <summary>
         ///创建空白文档
         /// </summary>
@@ -1666,7 +1703,6 @@ namespace PDF_Office.ViewModels
             CanSave = PDFViewer.UndoManager.CanSave;
             CanUndo = PDFViewer.UndoManager.CanUndo;
             CanRedo = PDFViewer.UndoManager.CanRedo;
-            region.Regions[ViwerRegionName].RemoveAll();
 
             //OpenFileInfo 内容赋值给PDFViewer
             GetOpenFileInfo();
@@ -1674,6 +1710,9 @@ namespace PDF_Office.ViewModels
             region.AddToRegion(ViwerRegionName, PDFViewer);
         }
 
+        /// <summary>
+        /// 还原上一次浏览的视图相关设置
+        /// </summary>
         private void GetOpenFileInfo()
         {
             OpenFileInfo = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);

File diff suppressed because it is too large
+ 232 - 0
PDF Office/Views/Dialog/NoviceGuidDialog.xaml


+ 28 - 0
PDF Office/Views/Dialog/NoviceGuidDialog.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Dialog
+{
+    /// <summary>
+    /// NoviceGuidDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class NoviceGuidDialog : UserControl
+    {
+        public NoviceGuidDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 137 - 66
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml

@@ -1,33 +1,42 @@
-<annotview:StickyPopupExt x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.StickyNotePopup"
-             xmlns:annotview="clr-namespace:ComPDFKitViewer;assembly=ComPDFKit.Viewer"
-             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.PropertyPanel.AnnotPanel"
-             mc:Ignorable="d" Background="Transparent"
-             d:DesignHeight="450" d:DesignWidth="800">
+<annotview:StickyPopupExt
+    x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.StickyNotePopup"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:annotview="clr-namespace:ComPDFKitViewer;assembly=ComPDFKit.Viewer"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+    d:DataContext="{d:DesignInstance Type=viewmodels:StickyNotePopupViewModel}"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    Background="Transparent"
+    mc:Ignorable="d">
     <annotview:StickyPopupExt.Resources>
         <DataTemplate x:Key="listboxData">
-            <Ellipse Stroke="{StaticResource color.sys.layout.divider}"
-                     StrokeThickness="1"
-                    Width="20"
-                    Height="20"
-                    Fill="{Binding Color}" />
+            <Ellipse
+                Width="20"
+                Height="20"
+                Fill="{Binding Color}"
+                Stroke="{StaticResource color.sys.layout.divider}"
+                StrokeThickness="1" />
         </DataTemplate>
 
         <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
             <Setter Property="HorizontalContentAlignment" Value="Center" />
-            <Setter Property="Height" Value="32"/>
-            <Setter Property="Width" Value="32"/>
+            <Setter Property="Height" Value="32" />
+            <Setter Property="Width" Value="32" />
             <Setter Property="Margin" Value="2,0,2,0" />
             <Setter Property="Template">
                 <Setter.Value>
                     <ControlTemplate TargetType="{x:Type ContentControl}">
-                        <Border CornerRadius="4"
-                                x:Name="border"
-                                Padding="0,0"
-                                Background="{TemplateBinding Background}">
+                        <Border
+                            x:Name="border"
+                            Padding="0,0"
+                            Background="{TemplateBinding Background}"
+                            CornerRadius="4">
                             <ContentPresenter />
                         </Border>
                     </ControlTemplate>
@@ -45,55 +54,111 @@
                     <Setter Property="Background" Value="#e2e3e5" />
                 </Trigger>
             </Style.Triggers>
-
         </Style>
     </annotview:StickyPopupExt.Resources>
     <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
-        <Border  x:Name="border" Background="{StaticResource color.sys.layout.anti}" CornerRadius="8" BorderThickness="2" BorderBrush="#ffe49a" MinWidth="240" MinHeight="200" Width="240" Height="200" >
+        <Border
+            x:Name="border"
+            Width="240"
+            Height="200"
+            MinWidth="240"
+            MinHeight="200"
+            Background="{StaticResource color.sys.layout.anti}"
+            BorderBrush="#ffe49a"
+            BorderThickness="2"
+            CornerRadius="8">
             <Border.Effect>
-                <DropShadowEffect BlurRadius="8" Direction="0" Opacity="0.16" ShadowDepth="0" Color="#000000" />
+                <DropShadowEffect
+                    BlurRadius="8"
+                    Direction="0"
+                    Opacity="0.16"
+                    ShadowDepth="0"
+                    Color="#000000" />
             </Border.Effect>
-            <Grid MinWidth="240" MinHeight="200" Background="Transparent" Name="GridUi" Width="240" Height="200">
+            <Grid
+                Name="GridUi"
+                Width="240"
+                Height="200"
+                MinWidth="240"
+                MinHeight="200"
+                Background="Transparent">
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="32"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="*"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
+                    <RowDefinition Height="32" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="*" />
+                    <RowDefinition Height="auto" />
                 </Grid.RowDefinitions>
                 <Grid Margin="8,0,8,0">
                     <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="auto"></ColumnDefinition>
-                        <ColumnDefinition Width="auto"></ColumnDefinition>
-                        <ColumnDefinition Width="*"></ColumnDefinition>
-                        <ColumnDefinition Width="auto"></ColumnDefinition>
-                        <ColumnDefinition Width="auto"></ColumnDefinition>
+                        <ColumnDefinition Width="auto" />
+                        <ColumnDefinition Width="auto" />
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="auto" />
+                        <ColumnDefinition Width="auto" />
                     </Grid.ColumnDefinitions>
-                    <TextBlock x:Name="AuthorText" Grid.Column="1" FontFamily="SegoeUI" FontSize="12" VerticalAlignment="Center" LineHeight="16" Margin="2,2,0,0"/>
-                    <TextBlock Name="DateText" Grid.Column="3" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center"  Margin="0,-2,0,0" FontFamily="SegoeUI" FontSize="12" LineHeight="16"></TextBlock>
-                    <Border Grid.Column="4" Visibility="Collapsed" MouseUp="CloseText_MouseUp" Background="#01000000" Margin="0,-8,-3,0">
-                        <Path Fill="#000000" Width="16" Height="16" >
+                    <TextBlock
+                        x:Name="AuthorText"
+                        Grid.Column="1"
+                        Margin="2,2,0,0"
+                        VerticalAlignment="Center"
+                        FontFamily="SegoeUI"
+                        FontSize="12"
+                        LineHeight="16"
+                        Text="{Binding AuthorText}" />
+                    <TextBlock
+                        Name="DateText"
+                        Grid.Column="3"
+                        Margin="0,-2,0,0"
+                        VerticalAlignment="Center"
+                        FontFamily="SegoeUI"
+                        FontSize="12"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                        LineHeight="16"
+                        Text="{Binding DateText}" />
+                    <Border
+                        Grid.Column="4"
+                        Margin="0,-8,-3,0"
+                        Background="#01000000"
+                        MouseUp="CloseText_MouseUp"
+                        Visibility="Collapsed">
+                        <Path
+                            Width="16"
+                            Height="16"
+                            Fill="#000000">
                             <Path.Data>
                                 M9.48528137,2.98528137 L9.48428137,8.48428137 L14.9852814,8.48528137 L14.9852814,9.48528137 L9.48428137,9.48428137 L9.48528137,14.9852814 L8.48528137,14.9852814 L8.48428137,9.48428137 L2.98528137,9.48528137 L2.98528137,8.48528137 L8.48428137,8.48428137 L8.48528137,2.98528137 L9.48528137,2.98528137 Z
                             </Path.Data>
                             <Path.LayoutTransform>
-                                <RotateTransform Angle="45"></RotateTransform>
+                                <RotateTransform Angle="45" />
                             </Path.LayoutTransform>
                         </Path>
                     </Border>
                 </Grid>
-                <Rectangle Margin="8,0,8,0" VerticalAlignment="Bottom" Height="1" Fill="{StaticResource color.sys.layout.divider}"/>
-                <TextBox  x:Name="ContentText" Grid.Row="2" Padding="2,4,0,0"  Margin="4,0,4,0" Background="#CCFFFFFF" BorderThickness="0" 
-                     AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
+                <Rectangle
+                    Height="1"
+                    Margin="8,0,8,0"
+                    VerticalAlignment="Bottom"
+                    Fill="{StaticResource color.sys.layout.divider}" />
+                <TextBox
+                    x:Name="ContentText"
+                    Grid.Row="2"
+                    Margin="4,0,4,0"
+                    Padding="2,4,0,0"
+                    AcceptsReturn="True"
+                    Background="#CCFFFFFF"
+                    BorderThickness="0"
+                    Text="{Binding ContentText}"
+                    TextWrapping="Wrap"
+                    VerticalScrollBarVisibility="Auto" />
 
                 <Grid Grid.Row="3">
                     <ListBox
-            x:Name="ListColor"
-            Background="Transparent"
-            BorderThickness="0"
-            ItemContainerStyle="{StaticResource listboxItemStyle}"
-            ItemTemplate="{StaticResource listboxData}"
-            SelectionChanged="ListColor_SelectionChanged"
-            >
+                        x:Name="ListColor"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        ItemContainerStyle="{StaticResource listboxItemStyle}"
+                        ItemTemplate="{StaticResource listboxData}"
+                        SelectionChanged="ListColor_SelectionChanged">
                         <ListBox.ItemsPanel>
                             <ItemsPanelTemplate>
                                 <WrapPanel Orientation="Horizontal" />
@@ -102,28 +167,34 @@
                     </ListBox>
                 </Grid>
 
-
                 <Button
-                        x:Name="BtnDelete" HorizontalAlignment="Right"
-                        Width="32" Grid.Row="3"
-                        Height="32"
-                        MaxHeight="40"
-                        Margin="16,0,10,5" BorderThickness="0"
-                        Foreground="#6B6F7D" Click="BtnDelete_Click"
-                        
-                        Style="{StaticResource btn.sec}">
+                    x:Name="BtnDelete"
+                    Grid.Row="3"
+                    Width="32"
+                    Height="32"
+                    MaxHeight="40"
+                    Margin="16,0,10,5"
+                    HorizontalAlignment="Right"
+                    BorderThickness="0"
+                    Click="BtnDelete_Click"
+                    Foreground="#6B6F7D"
+                    Style="{StaticResource btn.sec}">
                     <Path
-                            Width="32"
-                            Height="32"
-                            Data="M14 9.75H18V8.25H14V9.75ZM9 12.25H10.25V23C10.25 23.4142 10.5858 23.75 11 23.75H21C21.4142 23.75 21.75 23.4142 21.75 23V12.25H23V10.75H9V12.25ZM11.75 22.25V12.25H20.25V22.25H11.75ZM15.25 14.5V19.5H16.75V14.5H15.25Z"
-                            Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
+                        Width="32"
+                        Height="32"
+                        Data="M14 9.75H18V8.25H14V9.75ZM9 12.25H10.25V23C10.25 23.4142 10.5858 23.75 11 23.75H21C21.4142 23.75 21.75 23.4142 21.75 23V12.25H23V10.75H9V12.25ZM11.75 22.25V12.25H20.25V22.25H11.75ZM15.25 14.5V19.5H16.75V14.5H15.25Z"
+                        Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
                 </Button>
 
-
-                <ResizeGrip Name="GripControl" Visibility="Collapsed" Grid.Row="3" HorizontalAlignment="Right" Margin="0,2,0,0" Cursor="SizeNWSE" MouseMove="ResizeGrip_MouseMove"></ResizeGrip>
+                <ResizeGrip
+                    Name="GripControl"
+                    Grid.Row="3"
+                    Margin="0,2,0,0"
+                    HorizontalAlignment="Right"
+                    Cursor="SizeNWSE"
+                    MouseMove="ResizeGrip_MouseMove"
+                    Visibility="Collapsed" />
             </Grid>
-
         </Border>
-       
     </Grid>
-</annotview:StickyPopupExt>
+</annotview:StickyPopupExt>

+ 18 - 13
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl.CompositeControl;
+using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -24,17 +25,19 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
     /// <summary>
     /// StickyNotePopup.xaml 的交互逻辑
     /// </summary>
-   
+
     public class GripThumb : Thumb
     {
         private Pen DrawPen;
         private Brush FillBrush;
+
         public GripThumb()
         {
             DefaultStyleKey = typeof(GripThumb);
             DrawPen = new Pen(new SolidColorBrush(Colors.Blue), 2);
             FillBrush = new SolidColorBrush(Color.FromArgb(0x0A, 0xFF, 0xFF, 0xFF));
         }
+
         protected override void OnRender(DrawingContext DrawContext)
         {
             DrawContext.DrawRectangle(FillBrush, null, new Rect(0, 0, Width, Height));
@@ -43,6 +46,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             DrawContext.DrawLine(DrawPen, new Point(Width, Height * 2 / 3), new Point(Width * 2 / 3, Height));
         }
     }
+
     /// <summary>
     /// StickyNotePopup.xaml 的交互逻辑
     /// </summary>
@@ -53,6 +57,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         public Point OffsetParent;
 
         private byte saveOpacity = 1;
+
         public StickyNotePopup()
         {
             InitializeComponent();
@@ -82,7 +87,6 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             var ui = Mouse.DirectlyOver as FrameworkElement;
             if (ui != null)
             {
-
                 var colorItem = ui.DataContext as ColorItem;
                 if (colorItem != null)
                 {
@@ -90,7 +94,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
                     return;
                 }
             }
-
+            (DataContext as StickyNotePopupViewModel).ContentTextLostFocus.Execute();
             CloseText_MouseUp(this, null);
         }
 
@@ -132,7 +136,6 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
                             return;
                         }
                     }
-
                 }
 
                 ListColor.SelectedItem = null;
@@ -162,7 +165,6 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             }
         }
 
-
         public string StickyAuthor
         {
             get
@@ -190,6 +192,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         public StickyAnnotArgs GetCurrentAnnot { get; set; }
         public CPDFViewer GetPDFViewer { get; set; }
         public bool CanMove { get; set; } = true;
+
         private void ResizeGrip_MouseMove(object sender, MouseEventArgs e)
         {
             e.Handled = true;
@@ -217,7 +220,6 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             }
         }
 
-
         private void CloseText_MouseUp(object sender, MouseButtonEventArgs e)
         {
             if (e != null)
@@ -267,12 +269,13 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             PressPoint = new Point(0, 0);
             GripControl.ReleaseMouseCapture();
         }
+
         protected override void OnMouseMove(MouseEventArgs e)
         {
             e.Handled = true;
             if (e.LeftButton == MouseButtonState.Pressed && e.Source.GetType() != typeof(TextBox) && e.Source.GetType() != typeof(GripThumb))
             {
-                if (CanMove == false || (PressPoint.X == 0 && PressPoint.Y == 0))
+                if (CanMove == false || (PressPoint.X == 0 && PressPoint.Y == 0) || ContainerElement == null)
                 {
                     return;
                 }
@@ -343,7 +346,6 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             return StickyText;
         }
 
-
         private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             var colorItem = ListColor.SelectedItem as ColorItem;
@@ -375,18 +377,21 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
                 // Closed.Invoke(sender, EventArgs.Empty);
                 CloseText_MouseUp(this, null);
             }
-
         }
 
         private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-          var frame = e.OriginalSource as Control;
-            if(frame != null)
+            var frame = e.OriginalSource as Control;
+            if (frame != null)
             {
                 var color = frame.Background as SolidColorBrush;
-                if(color != null && color.Color == Colors.Transparent)
+                if (color != null && color.Color == Colors.Transparent)
                     Closed.Invoke(sender, EventArgs.Empty);
             }
         }
+
+        private void StickyPopupExt_LostFocus(object sender, RoutedEventArgs e)
+        {
+        }
     }
-}
+}

+ 13 - 2
PDF Office/Views/ViewContent.xaml

@@ -16,16 +16,19 @@
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     AllowDrop="True"
-    KeyDown="UserControl_KeyDown"
     DragEnter="UserControl_DragEnter"
-    DragOver="UserControl_DragOver"
     DragLeave="UserControl_DragLeave"
+    DragOver="UserControl_DragOver"
     Drop="UserControl_Drop"
+    KeyDown="UserControl_KeyDown"
     mc:Ignorable="d">
     <i:Interaction.Triggers>
         <i:EventTrigger EventName="Loaded">
             <prism:InvokeCommandAction Command="{Binding Load}" />
         </i:EventTrigger>
+        <i:EventTrigger EventName="PreviewMouseDown">
+            <prism:InvokeCommandAction Command="{Binding MouseDown}" />
+        </i:EventTrigger>
     </i:Interaction.Triggers>
     <UserControl.Resources>
         <ResourceDictionary>
@@ -479,6 +482,14 @@
                 VerticalAlignment="Top"
                 prism:RegionManager.RegionName="{Binding LeftTipContentRegionName}"
                 Visibility="{Binding LeftTipVisible}" />
+            <!--  便签弹窗  -->
+            <Canvas x:Name="CanvasNote" Grid.Column="2">
+                <ContentControl
+                    Canvas.Left="{Binding CanvasNoteLeft}"
+                    Canvas.Bottom="{Binding CanvasNoteTop}"
+                    prism:RegionManager.RegionName="{Binding NotePopupRegionName}"
+                    Visibility="{Binding NotePopupVisible}" />
+            </Canvas>
         </Grid>
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->