Browse Source

注释-链接-优化

OYXH\oyxh 2 years ago
parent
commit
1cb588c118

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 18 - 18
PDF Office/Styles/CustomBtnStyle.xaml

@@ -88,7 +88,7 @@
         <Setter Property="BorderThickness" Value="0" />
         <Setter Property="BorderThickness" Value="0" />
         <Setter Property="HorizontalContentAlignment" Value="Left" />
         <Setter Property="HorizontalContentAlignment" Value="Left" />
         <Setter Property="VerticalContentAlignment" Value="Top" />
         <Setter Property="VerticalContentAlignment" Value="Top" />
-        <Setter Property="Height" Value="40" />
+        <Setter Property="Height" Value="25" />
         <Setter Property="Template">
         <Setter Property="Template">
             <Setter.Value>
             <Setter.Value>
                 <ControlTemplate TargetType="customControl:CustomIconToggleBtn">
                 <ControlTemplate TargetType="customControl:CustomIconToggleBtn">
@@ -100,14 +100,14 @@
                         SnapsToDevicePixels="true">
                         SnapsToDevicePixels="true">
                         <Grid>
                         <Grid>
                             <Grid
                             <Grid
-                                Width="40"
-                                Height="40"
+                                Width="25"
+                                Height="25"
                                 HorizontalAlignment="Left"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Top">
                                 VerticalAlignment="Top">
                                 <Image
                                 <Image
                                     x:Name="ImageIcon"
                                     x:Name="ImageIcon"
-                                    Width="20"
-                                    Height="20"
+                                    Width="25"
+                                    Height="25"
                                     Source="{Binding Icon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                     Source="{Binding Icon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                     Visibility="Collapsed" />
                                     Visibility="Collapsed" />
                             </Grid>
                             </Grid>
@@ -626,19 +626,19 @@
         <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
         <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
         <Setter Property="BorderThickness" Value="0" />
         <Setter Property="BorderThickness" Value="0" />
         <!--<Style.Triggers>
         <!--<Style.Triggers>
-            <Trigger Property="IsMouseOver" Value="True">
-                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
-            </Trigger>
-            <Trigger Property="IsPressed" Value="True">
-                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
-            </Trigger>
-            <Trigger Property="IsChecked" Value="True">
-                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
-            </Trigger>
-            <Trigger Property="IsEnabled" Value="False">
-                <Setter Property="Background" Value="Transparent" />
-                <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
-            </Trigger>
+        <Trigger Property="IsMouseOver" Value="True">
+        <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+        </Trigger>
+        <Trigger Property="IsPressed" Value="True">
+        <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+        </Trigger>
+        <Trigger Property="IsChecked" Value="True">
+        <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+        </Trigger>
+        <Trigger Property="IsEnabled" Value="False">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+        </Trigger>
         </Style.Triggers>-->
         </Style.Triggers>-->
     </Style>
     </Style>
 
 

+ 4 - 3
PDF Office/Styles/ImageButtonStyle.xaml

@@ -1,6 +1,7 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
     <Style TargetType="{x:Type customControl:ImageButton}">
     <Style TargetType="{x:Type customControl:ImageButton}">
         <Setter Property="Background" Value="Transparent" />
         <Setter Property="Background" Value="Transparent" />
         <Setter Property="Template">
         <Setter Property="Template">

+ 4 - 3
PDF Office/Styles/ImageRadioButtonDictionary.xaml

@@ -1,6 +1,7 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
 
 
     <Style TargetType="{x:Type customControl:ImageRadioButton}">
     <Style TargetType="{x:Type customControl:ImageRadioButton}">
         <Setter Property="Background" Value="Transparent" />
         <Setter Property="Background" Value="Transparent" />

+ 7 - 1
PDF Office/Styles/PathButtonStyle.xaml

@@ -74,7 +74,13 @@
                                         Text="{TemplateBinding Content}"
                                         Text="{TemplateBinding Content}"
                                         TextTrimming="CharacterEllipsis" />
                                         TextTrimming="CharacterEllipsis" />
                                 </StackPanel>
                                 </StackPanel>
-                                <ContentPresenter  Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                <ContentPresenter
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                             </Grid>
                             </Grid>
                         </Grid>
                         </Grid>
                     </Border>
                     </Border>

+ 13 - 6
PDF Office/Styles/PathRadioButtonDictionary.xaml

@@ -1,7 +1,8 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
-    <Style TargetType="{x:Type customControl:PathRadioButton}" >
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
+    <Style TargetType="{x:Type customControl:PathRadioButton}">
         <Setter Property="IconOpacity" Value="1" />
         <Setter Property="IconOpacity" Value="1" />
         <Setter Property="IconMouseOverOpacity" Value="1" />
         <Setter Property="IconMouseOverOpacity" Value="1" />
         <Setter Property="IconPressOpacity" Value="1" />
         <Setter Property="IconPressOpacity" Value="1" />
@@ -72,7 +73,13 @@
                                         Text="{TemplateBinding Content}"
                                         Text="{TemplateBinding Content}"
                                         TextTrimming="CharacterEllipsis" />
                                         TextTrimming="CharacterEllipsis" />
                                 </StackPanel>
                                 </StackPanel>
-                                <ContentPresenter  Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                <ContentPresenter
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                             </Grid>
                             </Grid>
                         </Grid>
                         </Grid>
                     </Border>
                     </Border>
@@ -126,5 +133,5 @@
             </Setter.Value>
             </Setter.Value>
         </Setter>
         </Setter>
     </Style>
     </Style>
-    
+
 </ResourceDictionary>
 </ResourceDictionary>

+ 65 - 16
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -29,6 +29,7 @@ using System.Text.RegularExpressions;
 using System.Net;
 using System.Net;
 using System.Diagnostics;
 using System.Diagnostics;
 using static Dropbox.Api.TeamLog.TrustedTeamsRequestState;
 using static Dropbox.Api.TeamLog.TrustedTeamsRequestState;
+using System.Windows.Input;
 
 
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 {
 {
@@ -85,8 +86,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     if (AnnotArgs != null)
                     if (AnnotArgs != null)
                     {
                     {
                         AnnotArgs.DestIndex = pageNum - 1;
                         AnnotArgs.DestIndex = pageNum - 1;
-
-                        SetImagePreview(AnnotArgs.DestIndex);
+                        AnnotArgs.Content = string.Format($"To Page {AnnotArgs.DestIndex}");
+                        //isTextChanged = (int)AnnotAttribEvent.Attribs[AnnotAttrib.LinkDestIndx] != AnnotArgs.DestIndex ? true : false;
+                        //SetImagePreview(AnnotArgs.DestIndex);
                     }
                     }
                 }
                 }
                 else
                 else
@@ -118,6 +120,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     if (AnnotArgs != null)
                     if (AnnotArgs != null)
                     {
                     {
                         AnnotArgs.URI = pageWebTextContent;
                         AnnotArgs.URI = pageWebTextContent;
+                        AnnotArgs.Content = AnnotArgs.URI;
+                        //isTextChanged = (string)AnnotAttribEvent.Attribs[AnnotAttrib.LinkUri] != AnnotArgs.URI ? true : false;
                     }
                     }
                 }
                 }
 
 
@@ -140,6 +144,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     if (!string.IsNullOrEmpty(pageMailTextContent) && AnnotArgs != null)
                     if (!string.IsNullOrEmpty(pageMailTextContent) && AnnotArgs != null)
                     {
                     {
                         AnnotArgs.URI = "mailto:" + pageMailTextContent.Trim();
                         AnnotArgs.URI = "mailto:" + pageMailTextContent.Trim();
+                        AnnotArgs.Content = AnnotArgs.URI;
+                        //isTextChanged = (string)AnnotAttribEvent.Attribs[AnnotAttrib.LinkUri] != AnnotArgs.URI ? true : false;
                     }
                     }
                 }
                 }
                 return pageMailTextContent;
                 return pageMailTextContent;
@@ -409,6 +415,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
 
         private bool isLoaded = false;
         private bool isLoaded = false;
         private bool isMail = false;
         private bool isMail = false;
+        private bool isTextChanged = false;
         private string historyBtnGOorBackTag = string.Empty;
         private string historyBtnGOorBackTag = string.Empty;
         private int totalPage = 0;
         private int totalPage = 0;
         private int backPageIndex = 0;
         private int backPageIndex = 0;
@@ -419,7 +426,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         private Button btnGOorBack = null;
         private Button btnGOorBack = null;
         private LinkAnnotProperty linkAnnot;
         private LinkAnnotProperty linkAnnot;
         public DelegateCommand<object> LoadedCommand { get; set; }
         public DelegateCommand<object> LoadedCommand { get; set; }
-        public DelegateCommand<object> PageNumTextChangedCommand { get; set; }
+        public DelegateCommand<object> PageNumTextLostFocusCommand { get; set; }
+
+        public DelegateCommand<object> PageNumTextKeyDownCommand { get; set; }
         public DelegateCommand<object> BtnGOorBackPageCommand { get; set; }
         public DelegateCommand<object> BtnGOorBackPageCommand { get; set; }
         public DelegateCommand<object> LocationCommand { get; set; }
         public DelegateCommand<object> LocationCommand { get; set; }
 
 
@@ -428,13 +437,46 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public LinkAnnotPropertyViewModel()
         public LinkAnnotPropertyViewModel()
         {
         {
             LoadedCommand = new DelegateCommand<object>(Loaded);
             LoadedCommand = new DelegateCommand<object>(Loaded);
-            PageNumTextChangedCommand = new DelegateCommand<object>(PageNumTextChanged);
+            PageNumTextLostFocusCommand = new DelegateCommand<object>(PageNumTextLostFocus);
+            PageNumTextKeyDownCommand = new DelegateCommand<object>(PageNumTextKeyDown);
             BtnGOorBackPageCommand = new DelegateCommand<object>(BtnGOorBackPageEvent);
             BtnGOorBackPageCommand = new DelegateCommand<object>(BtnGOorBackPageEvent);
             LocationCommand = new DelegateCommand<object>(LocationPage);
             LocationCommand = new DelegateCommand<object>(LocationPage);
             ToggleButtonTabCommand = new DelegateCommand<object>(ToggleButtonTabSelected);
             ToggleButtonTabCommand = new DelegateCommand<object>(ToggleButtonTabSelected);
             isLoaded = true;
             isLoaded = true;
         }
         }
 
 
+        private void PageNumTextKeyDown(object obj)
+        {
+            if (obj is KeyEventArgs keyEventArgs)
+            {
+                if (keyEventArgs.Key == Key.Enter)
+                {
+                    PageNumTextLostFocus(obj);
+                }
+            }
+        }
+        private void PageNumTextLostFocus(object obj)
+        {
+            if (!string.IsNullOrEmpty(PageNumTextContent))
+            {
+                if (CheckPageNumVaild(out int pageNum, PageNumTextContent))
+                {
+                    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
+                    AnnotAttribEvent?.UpdateAnnot();
+
+                    AnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
+                    //isTextChanged = false;
+                    SetImagePreview(AnnotArgs.DestIndex);
+                }
+                else
+                {
+                    ImagePreviewVisibility = Visibility.Collapsed;
+                    BtnGOorBackVisibility = Visibility.Collapsed;
+                }
+            }
+        }
+
         private void ToggleButtonTabSelected(object obj)
         private void ToggleButtonTabSelected(object obj)
         {
         {
             if (obj is RadioButton radioButton)
             if (obj is RadioButton radioButton)
@@ -518,16 +560,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// <param name="obj"></param>
         /// <param name="obj"></param>
         private void LocationPage(object obj)
         private void LocationPage(object obj)
         {
         {
-            if (!string.IsNullOrEmpty(PageNumTextContent))
+            if (string.IsNullOrEmpty(PageNumTextContent))
             {
             {
-                if (CheckPageNumVaild(out int pageNum, PageNumTextContent))
-                {
-                    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
-                    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
-                    AnnotAttribEvent?.UpdateAnnot();
+                //if (CheckPageNumVaild(out int pageNum, PageNumTextContent))
+                //{
+                //    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                //    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
+                //    AnnotAttribEvent?.UpdateAnnot();
 
 
-                    AnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
-                }
+                //    AnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
+                //    //isTextChanged = false;
+                //}
             }
             }
         }
         }
 
 
@@ -609,6 +652,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
 
             if (btnGOorBack.Tag.ToString() == "GO")
             if (btnGOorBack.Tag.ToString() == "GO")
             {
             {
+                //AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                //AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageIndex);
+                //AnnotAttribEvent?.UpdateAnnot();
+
                 historyPageIndex = AnnotArgs != null ? AnnotArgs.PageIndex : backPageIndex;
                 historyPageIndex = AnnotArgs != null ? AnnotArgs.PageIndex : backPageIndex;
                 pdfViewer.GoToPage(pageIndex);
                 pdfViewer.GoToPage(pageIndex);
 
 
@@ -696,7 +743,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
             {
                 ShowPageNumTip = Visibility.Collapsed;
                 ShowPageNumTip = Visibility.Collapsed;
             }
             }
-            BtnGOorBackVisibility = Visibility.Visible;
+            //BtnGOorBackVisibility = Visibility.Visible;
 
 
             return true;
             return true;
         }
         }
@@ -836,8 +883,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 totalPage = pdfViewer.Document.PageCount;
                 totalPage = pdfViewer.Document.PageCount;
 
 
                 SetTextBoxEnableOrNot(false, totalPage);
                 SetTextBoxEnableOrNot(false, totalPage);
-
-                GetAnnotAttribute();
+                if (AnnotAttribEvent.IsAnnotCreateReset == false)
+                {
+                    GetAnnotAttribute();
+                }
 
 
                 if (isLoaded)
                 if (isLoaded)
                 {
                 {
@@ -944,7 +993,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 PageNumTextIsEnabled = true;
                 PageNumTextIsEnabled = true;
                 ImagePreviewVisibility = Visibility.Visible;
                 ImagePreviewVisibility = Visibility.Visible;
 
 
-                //SetImagePreview(pageNum - 1);
+                SetImagePreview(pageNum - 1);
 
 
                 //if (btnGOorBack != null)
                 //if (btnGOorBack != null)
                 //{
                 //{

+ 3 - 5
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -154,7 +154,7 @@ namespace PDF_Office.ViewModels.Tools
             return highlightArgs;
             return highlightArgs;
         }
         }
 
 
-        private AnnotHandlerEventArgs GetLink(LinkAnnotArgs selectedfreetextArgs = null, AnnotAttribEvent annotAttribEvent = null)
+        private AnnotHandlerEventArgs GetLink(LinkAnnotArgs selectedLinkAnnotArgs = null, AnnotAttribEvent annotAttribEvent = null)
         {
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             LinkAnnotArgs linkArgs = new LinkAnnotArgs();
             LinkAnnotArgs linkArgs = new LinkAnnotArgs();
@@ -163,11 +163,9 @@ namespace PDF_Office.ViewModels.Tools
             {
             {
             }
             }
 
 
-            if (selectedfreetextArgs != null)
+            if (selectedLinkAnnotArgs != null)
             {
             {
-                linkArgs.URI = selectedfreetextArgs.URI;
-                linkArgs.LinkType = selectedfreetextArgs.LinkType;
-                linkArgs.DestIndex = selectedfreetextArgs.DestIndex;
+                linkArgs = selectedLinkAnnotArgs;
             }
             }
             else
             else
             {
             {

File diff suppressed because it is too large
+ 25 - 12
PDF Office/Views/BOTA/AnnotationListItem.xaml


+ 21 - 1
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -2,6 +2,7 @@
 using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFPage;
 using ComPDFKit.PDFPage;
+using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Helper;
 using PDF_Office.Helper;
@@ -18,6 +19,7 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls;
 using System.Windows.Data;
 using System.Windows.Data;
 using System.Windows.Documents;
 using System.Windows.Documents;
+using System.Windows.Forms;
 using System.Windows.Input;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Media.Imaging;
@@ -29,7 +31,7 @@ namespace PDF_Office.Views.BOTA
     /// <summary>
     /// <summary>
     /// AnnotationListItem.xaml 的交互逻辑
     /// AnnotationListItem.xaml 的交互逻辑
     /// </summary>
     /// </summary>
-    public partial class AnnotationListItem : UserControl
+    public partial class AnnotationListItem : System.Windows.Controls.UserControl
     {
     {
         //private Brush strikeoutColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
         //private Brush strikeoutColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
         public AnnotationListItem()
         public AnnotationListItem()
@@ -200,6 +202,24 @@ namespace PDF_Office.Views.BOTA
                     }
                     }
                     break;
                     break;
 
 
+                case AnnotArgsType.AnnotLink:
+                    BtnAnnotLink.Visibility = Visibility.Visible;
+                    if (data is LinkAnnotArgs linkAnnotArgs)
+                    {
+                        //Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
+                        //annotAttribsList[AnnotAttrib.LinkType] = linkAnnotArgs.LinkType;
+                        //annotAttribsList[AnnotAttrib.LinkUri] = linkAnnotArgs.URI;
+                        //annotAttribsList[AnnotAttrib.LinkDestIndx] = linkAnnotArgs.DestIndex;
+                        //AnnotAttribEvent annotAttribEvent = AnnotAttribEvent.GetAnnotAttribEvent(linkAnnotArgs, annotAttribsList);
+                        if (string.IsNullOrEmpty(linkAnnotArgs.Content))
+                        {
+                            //if(data.)
+                            TxbContext.Text = string.Format($"To Page {linkAnnotArgs.PageIndex}");
+                        }
+                    }
+
+                    break;
+
                 default:
                 default:
                     break;
                     break;
             }
             }

+ 13 - 3
PDF Office/Views/PropertyPanel/AnnotPanel/LinkAnnotProperty.xaml

@@ -181,16 +181,26 @@
                             VerticalContentAlignment="Center"
                             VerticalContentAlignment="Center"
                             IsEnabled="{Binding PageNumTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             IsEnabled="{Binding PageNumTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             IsError="{Binding ElementName=PageNumText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             IsError="{Binding ElementName=PageNumText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+
                             PlaceHoldText="{Binding PageNumPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             PlaceHoldText="{Binding PageNumPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             ShowTip="{Binding ShowPageNumTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             ShowTip="{Binding ShowPageNumTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             Text="{Binding PageNumTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                             Text="{Binding PageNumTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TipText="{Binding PageNumTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                            TipText="{Binding PageNumTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="LostFocus">
+                                    <i:InvokeCommandAction Command="{Binding PageNumTextLostFocusCommand}" PassEventArgsToCommand="True" />
+                                </i:EventTrigger>
+                                <i:EventTrigger EventName="KeyDown">
+                                    <i:InvokeCommandAction Command="{Binding PageNumTextKeyDownCommand}" PassEventArgsToCommand="True" />
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </CustomControl:TextBoxWithTip>
                     </StackPanel>
                     </StackPanel>
                     <Button
                     <Button
                         Name="BtnLocation"
                         Name="BtnLocation"
                         Width="228"
                         Width="228"
                         Height="32"
                         Height="32"
-                        Margin="16,16,16,0"
+                        Margin="16,30,16,0"
                         Command="{Binding LocationCommand}"
                         Command="{Binding LocationCommand}"
                         IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Style="{StaticResource btn.sec-icon}">
                         Style="{StaticResource btn.sec-icon}">
@@ -202,7 +212,7 @@
                                     VerticalAlignment="Center"
                                     VerticalAlignment="Center"
                                     Data="M15.064 6.88052L13.5661 6.49468L9.57748 11.6857L10.2156 13.8898C10.3593 14.3863 9.74722 14.7479 9.38174 14.3824L6.59721 11.5979L0.0145727 15.9711L4.38786 9.38851L1.60356 6.60421C1.23807 6.23873 1.59967 5.62665 2.09615 5.77038L4.30107 6.40871L9.49166 2.42039L9.10576 0.92227C8.97879 0.42937 9.58359 0.0840825 9.9435 0.443993L15.5423 6.04277C15.9022 6.40268 15.5569 7.00748 15.064 6.88052Z"
                                     Data="M15.064 6.88052L13.5661 6.49468L9.57748 11.6857L10.2156 13.8898C10.3593 14.3863 9.74722 14.7479 9.38174 14.3824L6.59721 11.5979L0.0145727 15.9711L4.38786 9.38851L1.60356 6.60421C1.23807 6.23873 1.59967 5.62665 2.09615 5.77038L4.30107 6.40871L9.49166 2.42039L9.10576 0.92227C8.97879 0.42937 9.58359 0.0840825 9.9435 0.443993L15.5423 6.04277C15.9022 6.40268 15.5569 7.00748 15.064 6.88052Z"
                                     Fill=" #616469" />
                                     Fill=" #616469" />
-                                <TextBlock Margin="10,0" Text="Locate the target page" />
+                                <TextBlock Margin="10,0" Text="定位目标区域" />
                             </StackPanel>
                             </StackPanel>
                         </Button.Content>
                         </Button.Content>
                     </Button>
                     </Button>

+ 21 - 3
PDF Office/Views/ViewContent.xaml

@@ -224,8 +224,6 @@
             </TabControl>
             </TabControl>
         </Grid>
         </Grid>
 
 
-
-
         <!--  底部工具栏  -->
         <!--  底部工具栏  -->
         <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
         <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
 
 
@@ -289,9 +287,29 @@
                 Grid.Column="2"
                 Grid.Column="2"
                 HorizontalAlignment="Stretch"
                 HorizontalAlignment="Stretch"
                 prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
                 prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
-            <ScrollViewer Name="Scroller" Grid.Column="4" Focusable="False" VerticalScrollBarVisibility="Auto">
+            <ScrollViewer
+                Name="Scroller"
+                Grid.Column="4"
+                Focusable="False"
+                VerticalScrollBarVisibility="Auto">
                 <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
                 <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
             </ScrollViewer>
             </ScrollViewer>
+            <Border
+                Name="ViewContentTipPanel"
+                Grid.Column="2"
+                Width="{Binding ElementName=PDFViewerContent, Path=Width}"
+                HorizontalAlignment="Stretch"
+                VerticalAlignment="Top"
+                Background=" #BDDFFD"
+                Visibility="Collapsed">
+                <TextBlock
+                    x:Name="DrawTipsText"
+                    Margin="12,4"
+                    Padding="4,2,4,2"
+                    FontSize="14"
+                    Foreground="#252629"
+                    Text="Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range" />
+            </Border>
         </Grid>
         </Grid>
 
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->

BIN
PDFSettings/bin/Debug/ComPDFKit.Viewer.dll