Browse Source

注释-链接在未框选区域或未选中页面内容的情况下进入超链接模式,属性面板显示空状态提示
---》备注:选中文字或图片右键菜单进入超链接模式,属性面板显示正常

OYXH\oyxh 1 year ago
parent
commit
e0763e9618

+ 1 - 0
PDF Office/PDF Master.csproj

@@ -2272,6 +2272,7 @@
     <Resource Include="Resources\Service\IAPBottom.png" />
     <Resource Include="Resources\Service\IAPTop.png" />
     <Resource Include="Resources\HomeIcon\noScanner.png" />
+    <Resource Include="Resources\PropertyPanel\no link.png" />
     <Content Include="Resources\Service\Login.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

BIN
PDF Office/Resources/PropertyPanel/no link.png


+ 101 - 17
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -40,6 +40,7 @@ using DryIoc;
 using static Dropbox.Api.TeamLog.PaperDownloadFormat;
 using ComPDFKit.Import;
 using ComPDFKit.PDFAnnotation;
+using PDF_Master.Model.AnnotPanel;
 
 namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 {
@@ -69,10 +70,22 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private string T_emptyTitle;
+
+        public string T_EmptyTitle
+        {
+            get { return T_emptyTitle; }
+            set
+            {
+                SetProperty(ref T_emptyTitle, value);
+            }
+        }
+
         private void InitString()
         {
             T_Title = App.MainPageLoader.GetString("Link_Title");
             T_Page = App.MainPageLoader.GetString("Link_Page");
+            T_EmptyTitle = "Select an area or text on a page to add a link";
         }
 
         #endregion 文案
@@ -103,6 +116,17 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private Visibility isEmptyPanelVisibility = Visibility.Visible;
+
+        public Visibility IsEmptyPanelVisibility
+        {
+            get { return isEmptyPanelVisibility; }
+            set
+            {
+                SetProperty(ref isEmptyPanelVisibility, value);
+            }
+        }
+
         private AnnotArgsType annotType;
 
         public AnnotArgsType AnnotType
@@ -612,12 +636,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             {
                 if (CheckPageNumVaild(out int pageNum, PageNumTextContent))
                 {
-                    
-                    //isSelected = true;
+                    propertyPanel.IsAddLink = false;
+
+                    if (LinkAnnotArgs.PageIndex == -1)
+                    {
+                        LinkAnnotArgs.PageIndex = pdfViewer.CurrentIndex;
+                    }
                     historyPageIndex = LinkAnnotArgs.PageIndex;
-                    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
-                    AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
-                    AnnotAttribEvent?.UpdateAnnot();
+                    //AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                    //AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
+                    //AnnotAttribEvent?.UpdateAnnot();
 
                     //isTextChanged = false;
                     SetImagePreview(LinkAnnotArgs.DestIndex);
@@ -625,18 +653,33 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     //BtnGOorBackVisibility= Visibility.Collapsed;
                     BtnLocationIsEnabled = false;
 
-                    LinkAnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
+                    if (viewContentViewModel.IsRightMenuSelectedTextAddLink == false)
+                    {
+                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
+                        AnnotAttribEvent?.UpdateAnnot();
+                        LinkAnnotArgs?.InvokeLinkSaveCalled(this, EventArgs.Empty);
+                    }
+                    else
+                    {
+                        //右键选择文本 创建链接
+                        //viewContentViewModel.IsRightMenuSelectedTextAddLink = false;
+                        LinkAnnotArgs.DestIndex = pageNum - 1;
+                        pdfViewer.CreatePageAnnot(pdfViewer.CurrentIndex, LinkAnnotArgs);
+                    }
 
-                    if (propertyPanel.IsAddLink)
+                    if (viewContentViewModel.IsRightMenuSelectedTextAddLink || viewContentViewModel.IsRightMenuCreateLink)
                     {
-                        propertyPanel.IsAddLink = false;
+                        viewContentViewModel.IsRightMenuSelectedTextAddLink = false;
+                        viewContentViewModel.IsRightMenuCreateLink = false;
+
                         viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
                         var annotArgs = new SelectToolArgs();
                         pdfViewer.SetToolParam(annotArgs);
+                        return;
                     }
 
                     SelectAnnotation();
-                    
                 }
                 else
                 {
@@ -816,6 +859,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         propertyPanel.IsAddLink = false;
                         System.Windows.Size pageSize = pdfViewer.Document.GetPageSize(areaInfo.PageIndex);
 
+                        if (LinkAnnotArgs.PageIndex == -1)
+                        {
+                            LinkAnnotArgs.PageIndex = historyPageIndex;
+                        }
                         historyPageIndex = LinkAnnotArgs.PageIndex;
 
                         AnnotAttribEvent = propertyPanel.AnnotEvent;
@@ -824,12 +871,22 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         LinkAnnotArgs.IsPositionSet = true;
                         LinkAnnotArgs.DestIndex = areaInfo.PageIndex;
                         LinkAnnotArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
-                        paintrect = LinkAnnotArgs.GetLinkCreateArea();
+                        if (viewContentViewModel.IsRightMenuSelectedTextAddLink == false)
+                        {
+                            AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
+                            AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
+                            AnnotAttribEvent?.UpdateAnnot();
+                            LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
+                        }
+                        else
+                        {
+                            //右键选择文本 创建链接
 
-                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
-                        AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
-                        AnnotAttribEvent?.UpdateAnnot();
-                        LinkAnnotArgs.InvokeLinkSaveCalled(this, EventArgs.Empty);
+                            pdfViewer.CreatePageAnnot(historyPageIndex, LinkAnnotArgs);
+                        }
+
+                        //精准定位
+                        paintrect = LinkAnnotArgs.GetLinkCreateArea();
 
                         pdfViewer.GoToPage(historyPageIndex);
 
@@ -847,6 +904,18 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                         viewContentViewModel.TipVisible = Visibility.Collapsed;
 
+                        //右键选择文本 创建链接
+                        if (viewContentViewModel.IsRightMenuSelectedTextAddLink || viewContentViewModel.IsRightMenuCreateLink)
+                        {
+                            viewContentViewModel.IsRightMenuSelectedTextAddLink = false;
+                            viewContentViewModel.IsRightMenuCreateLink = false;
+                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                            pdfViewer.DisableClearSelectAnnot(false);
+                            pdfViewer.ClearSelectAnnots();
+                            var annotArgs = new SelectToolArgs();
+                            pdfViewer.SetToolParam(annotArgs);
+                            return;
+                        }
                         //没有选择注释工具、也不是右键添加注释
                         //在阅读页,选择注释后,点击按钮
                         //需要设置相关参数
@@ -865,7 +934,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         {
             viewContentViewModel.TipVisible = Visibility.Collapsed;
             BtnLocationIsChecked = false;
-            propertyPanel.IsLocationLink = false;
             //没有选择注释工具、也不是右键添加注释
             //在阅读页,选择注释后,点击按钮
             //需要设置相关参数
@@ -1240,6 +1308,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         /// <param name="e"></param>
         private void linkAnnotArgs_LinkDrawFinished(object sender, bool e)
         {
+            IsEmptyPanelVisibility = e ? Visibility.Collapsed : Visibility.Visible;
             SetTextBoxEnableOrNot(e, totalPage);
         }
 
@@ -1282,13 +1351,23 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 document = pdfViewer.Document;
                 totalPage = pdfViewer.Document.PageCount;
 
-                if (viewContentViewModel.IsRightMenuCreateLink)
+                if (viewContentViewModel.IsRightMenuCreateLink || viewContentViewModel.IsRightMenuSelectedTextAddLink)
                 {
+                    IsEmptyPanelVisibility = viewContentViewModel.IsRightMenuSelectedTextAddLink ? Visibility.Collapsed : Visibility.Visible;
                     SetTextBoxEnableOrNot(true, totalPage);
-                    viewContentViewModel.IsRightMenuCreateLink = false;
+
+                    //viewContentViewModel.IsRightMenuSelectedTextAddLink=false;
                 }
                 else
                 {
+                    if (propertyPanel.annot.AnnotIndex == -1 && propertyPanel.annot.PageIndex == -1)
+                    {
+                        IsEmptyPanelVisibility = Visibility.Visible;
+                    }
+                    if (AnnotAttribEvent.IsAnnotCreateReset == false && propertyPanel.annot.AnnotIndex != -1 && propertyPanel.annot.PageIndex != -1)
+                    {
+                        IsEmptyPanelVisibility = Visibility.Collapsed;
+                    }
                     SetTextBoxEnableOrNot(false, totalPage);
                 }
                 if (AnnotAttribEvent.IsAnnotCreateReset == false)
@@ -1325,6 +1404,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                             }
                         }
                     }
+                    //右键选择文本 创建链接
+                    else
+                    {
+                        LinkAnnotArgs = (LinkAnnotArgs)propertyPanel.annot;
+                    }
                 }
 
                 if (LinkAnnotArgs == null)

+ 0 - 1
PDF Office/ViewModels/Tools/AnnotManager/AnnotTransfer.cs

@@ -20,7 +20,6 @@ namespace PDF_Master.ViewModels.Tools.AnnotManager
         public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;
 
         public bool IsAddLink = false;
-        public bool IsLocationLink = false;
         public bool IsSelectedTextAddLink = false;
         public bool IsSelectedTextAddShape = false;
         public AnnotAttribEvent AnnotEvent { get; set; }

+ 36 - 29
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -178,6 +178,10 @@ namespace PDF_Master.ViewModels.Tools
         {
             if (isChecked == false)
             {
+                if (PDFViewer == null)
+                {
+                    return;
+                }
                 //鼠标框选多选注释
                 if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
                 {
@@ -200,8 +204,8 @@ namespace PDF_Master.ViewModels.Tools
 
         //点击注释工具
         private void BtnMyTools_Click(CustomIconToggleBtn annotBtn)
-        {
-            if (annotBtn == null || annotBtn.Tag == null) return;
+        {
+            if (PDFViewer == null || annotBtn == null || annotBtn.Tag == null) return;
 
             //不创建注释,属于注释模板
             Dictionary<string, bool> dictVar = new Dictionary<string, bool>();
@@ -636,19 +640,18 @@ namespace PDF_Master.ViewModels.Tools
                         linkArgs.ClientRect = annotCommand.TextRect;
                         linkArgs.URI = string.Empty;
                         linkArgs.LinkType = LINK_TYPE.GOTO;
-                        linkArgs.DestIndex = annotCommand.PageIndex;
-                        PDFViewer.CreatePageAnnot(annotCommand.PageIndex, linkArgs);
-                        //BtnLinkIsChecked = true;
-                        //StrAnnotToolChecked = "Link";
-                        //List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
-                        //lists.Add(linkArgs);
-                        //PropertyPanel.IsAddLink = true;
-
-                        //AnnotHandlerEventArgs annotArgs = GetLink(lists);
-                        //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
-                        //PDFViewer.SetToolParam(annotArgs);
+                        //linkArgs.DestIndex = annotCommand.PageIndex;
+                        //PDFViewer.CreatePageAnnot(annotCommand.PageIndex, linkArgs);
+
+                        List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
+                        lists.Add(linkArgs);
+                        PropertyPanel.IsAddLink = true;
+                        viewContentViewModel.IsRightMenuSelectedTextAddLink = true;
+                        AnnotHandlerEventArgs annotArgs = GetLink(lists);
+                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        PDFViewer.SetToolParam(annotArgs);
                         viewContentViewModel.IsPropertyOpen = true;
-                        PDFViewer.SelectAnnotation(linkArgs.PageIndex, linkArgs.AnnotIndex);
+                        //PDFViewer.SelectAnnotation(linkArgs.PageIndex, linkArgs.AnnotIndex);
 
                         break;
 
@@ -689,7 +692,8 @@ namespace PDF_Master.ViewModels.Tools
                         ExportPicture_MenuItemClick();
                         break;
                 }
-                ExitAnnotationTool();
+                if (clickMenu.Tag.ToString() != "Link")
+                    ExitAnnotationTool();
                 //ShowPropertyPanel(false);
             }
         }
@@ -1694,8 +1698,8 @@ namespace PDF_Master.ViewModels.Tools
             //        }
             //    }
             //
-            
-            if (e.Key == Key.Escape )
+
+            if (e.Key == Key.Escape)
             {
                 PropertyPanel.IsAddLink = false;
                 if (PDFViewer.MouseMode == MouseModes.AnnotCreate)
@@ -1727,6 +1731,8 @@ namespace PDF_Master.ViewModels.Tools
                             case AnnotArgsType.AnnotFreehand:
                             case AnnotArgsType.AnnotSelectTool:
                                 ExitAnnotationTool();
+
+                                events.GetEvent<LinkAnnotTipCloseEvent>().Publish(new LinkAnnotTipCloseArgs() { UniCode = App.mainWindowViewModel.SelectedItem.Unicode });
                                 break;
                         }
                     }
@@ -1734,11 +1740,8 @@ namespace PDF_Master.ViewModels.Tools
                 else
                 {
                     ExitAnnotationTool();
-                }
-                
-               
-            }
-
+                }
+            }
             else if (KeyEventsHelper.IsModifierKey(ModifierKeys.Shift, Key.None))
             {
                 //按住Shift等比缩放
@@ -1767,6 +1770,7 @@ namespace PDF_Master.ViewModels.Tools
             PDFViewer.SetMouseMode(MouseModes.PanTool);
             HandToolIsCheckedEvent(false);
             BtnHandIsChecked = false;
+            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
             ShowPropertyPanel(false);
         }
 
@@ -1903,13 +1907,16 @@ namespace PDF_Master.ViewModels.Tools
             {
                 OpenFileInfo = viewContentViewModel.OpenFileInfo;
             }
-            BindingPDFViewerHandler();
-            BindingEvent();
-            LoaedStickyNotePopup();
-            //获取当前是否为滚动状态
-            // BtnHandIsChecked = (PDFViewer.MouseMode == MouseModes.Scroll ? true : false);
-            BtnHandIsChecked = false;
-            HandToolIsCheckedEvent(false);
+            if (PDFViewer != null)
+            {
+                BindingPDFViewerHandler();
+                BindingEvent();
+                LoaedStickyNotePopup();
+                //获取当前是否为滚动状态
+                // BtnHandIsChecked = (PDFViewer.MouseMode == MouseModes.Scroll ? true : false);
+                BtnHandIsChecked = false;
+                HandToolIsCheckedEvent(false);
+            }
         }
 
         #endregion Navigation

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

@@ -701,6 +701,7 @@ namespace PDF_Master.ViewModels
 
         private string linkAnnotTipText = "Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range";
         private bool isCreateLink = false;
+        internal bool IsRightMenuSelectedTextAddLink = false;
 
         public string LinkAnnotTipText
         {
@@ -895,7 +896,7 @@ namespace PDF_Master.ViewModels
         private void AutoSaveTimer_Tick(object sender, EventArgs e)
         {
             var autoSave = Settings.Default.AppProperties.Description.AutoSave;
-            if (autoSave && !mainViewModel.NewFile&&PDFViewer.UndoManager.CanSave)
+            if (autoSave && !mainViewModel.NewFile && PDFViewer.UndoManager.CanSave)
             {
                 //自动保存仅针对已经有文件路径的文档
                 saveFile();
@@ -1178,7 +1179,7 @@ namespace PDF_Master.ViewModels
             if ((!PDFViewer.Document.IsEncrypted && !SecurityInfo.IsPasswordChanged) || (SecurityInfo.IsPasswordRemoved))
             {
                 AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.ShowDialog("","No security settings available ","OK");
+                alertsMessage.ShowDialog("", "No security settings available ", "OK");
             }
             else
             {
@@ -1970,7 +1971,7 @@ namespace PDF_Master.ViewModels
             //ReadModelTip = Visibility.Collapsed;
             TipVisible = Visibility.Collapsed;
 
-            
+
         }
 
         #region PDFViewer鼠标滚轮缩放事件
@@ -2017,7 +2018,7 @@ namespace PDF_Master.ViewModels
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             App.mainWindowViewModel.OphVis = Visibility.Collapsed;
-            if (App.IsShowRegist&& App.IsLogin==true)
+            if (App.IsShowRegist && App.IsLogin == true)
             {
                 App.mainWindowViewModel.OpenRegister();
                 App.IsShowRegist = false;

+ 171 - 149
PDF Office/Views/PropertyPanel/AnnotPanel/LinkAnnotProperty.xaml

@@ -30,6 +30,7 @@
             <Convert:StringToUnVisibleConvert x:Key="StringToUnVisibleConvert" />
             <Convert:BoolToVisible x:Key="BoolToVisible" />
             <Convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
+            <Convert:UnVisivleConvert x:Key="UnVisivleConvert" />
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid>
@@ -165,159 +166,180 @@
             X2="232"
             Y1="0"
             Y2="0" />-->
-            <Grid MinWidth="260">
-                <!--<StackPanel Name="LinkPagePanel" Visibility="{Binding ElementName=BtnLinkPage, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
-                <StackPanel Name="LinkPagePanel">
-                    <TextBlock
-                        x:Name="TxtPage"
-                        Height="20"
-                        Margin="16,0,0,4"
-                        FontFamily="Segoe UI"
-                        FontSize="12"
-                        FontWeight="Bold"
-                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
-                        LineHeight="20"
-                        Text="{Binding T_Page}" />
-                    <StackPanel Orientation="Horizontal">
-                        <CustomControl:TextBoxWithTip
-                            x:Name="PageNumText"
+            <StackPanel Orientation="Vertical"  Visibility="{Binding IsEmptyPanelVisibility, Converter={StaticResource UnVisivleConvert}}">
+                <Grid MinWidth="260">
+                    <!--<StackPanel Name="LinkPagePanel" Visibility="{Binding ElementName=BtnLinkPage, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
+                    <StackPanel Name="LinkPagePanel">
+                        <TextBlock
+                            x:Name="TxtPage"
+                            Height="20"
+                            Margin="16,0,0,4"
+                            FontFamily="Segoe UI"
+                            FontSize="12"
+                            FontWeight="Bold"
+                            Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                            LineHeight="20"
+                            Text="{Binding T_Page}" />
+                        <StackPanel Orientation="Horizontal">
+                            <CustomControl:TextBoxWithTip
+                                x:Name="PageNumText"
+                                Width="228"
+                                Margin="16,0"
+                                VerticalContentAlignment="Center"
+                                IsEnabled="{Binding PageNumTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                IsError="{Binding ElementName=PageNumText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                PlaceHoldText="{Binding PageNumPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                ShowTip="{Binding ShowPageNumTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                Text="{Binding PageNumTextContent, 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>
+                        <ToggleButton
+                            Name="BtnLocation"
                             Width="228"
-                            Margin="16,0"
-                            VerticalContentAlignment="Center"
-                            IsEnabled="{Binding PageNumTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            IsError="{Binding ElementName=PageNumText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            PlaceHoldText="{Binding PageNumPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            ShowTip="{Binding ShowPageNumTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            Text="{Binding PageNumTextContent, 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>
+                            Height="32"
+                            Margin="16,30,16,0"
+                            Background="Transparent"
+                            BorderBrush="Transparent"
+                            BorderThickness="0"
+                            Command="{Binding LocationCommand}"
+                            IsChecked="{Binding BtnLocationIsChecked}"
+                            IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            Style="{StaticResource LinkToolbarTgb}">
+                            <ToggleButton.Content>
+                                <StackPanel Orientation="Horizontal">
+                                    <Path
+                                        Name="PathLocation"
+                                        HorizontalAlignment="Left"
+                                        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"
+                                        Fill=" #616469" />
+                                    <TextBlock Margin="10,0" Text="定位目标区域" />
+                                </StackPanel>
+                            </ToggleButton.Content>
+                        </ToggleButton>
+                        <Image
+                            Name="ImagePreview"
+                            Width="{Binding ImagePreviewWidth}"
+                            Height="{Binding ImagePreviewHeight}"
+                            Margin="32"
+                            Source="{Binding PreviewImage}"
+                            Visibility="{Binding ImagePreviewVisibility}" />
                     </StackPanel>
-                    <ToggleButton
-                        Name="BtnLocation"
-                        Width="228"
-                        Height="32"
-                        Margin="16,30,16,0"
-                        Background="Transparent"
-                        BorderBrush="Transparent"
-                        BorderThickness="0"
-                        Command="{Binding LocationCommand}"
-                        IsChecked="{Binding BtnLocationIsChecked}"
-                        IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                        Style="{StaticResource LinkToolbarTgb}">
-                        <ToggleButton.Content>
-                            <StackPanel Orientation="Horizontal">
-                                <Path
-                                    Name="PathLocation"
-                                    HorizontalAlignment="Left"
-                                    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"
-                                    Fill=" #616469" />
-                                <TextBlock Margin="10,0" Text="定位目标区域" />
-                            </StackPanel>
-                        </ToggleButton.Content>
-                    </ToggleButton>
-                    <Image
-                        Name="ImagePreview"
-                        Width="{Binding ImagePreviewWidth}"
-                        Height="{Binding ImagePreviewHeight}"
-                        Margin="32"
-                        Source="{Binding PreviewImage}"
-                        Visibility="{Binding ImagePreviewVisibility}" />
-                </StackPanel>
-                <StackPanel Name="LinkWebPanel" Visibility="{Binding ElementName=BtnLinkWeb, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">
-                    <TextBlock
-                        Height="20"
-                        Margin="16,12,0,4"
-                        FontFamily="Segoe UI"
-                        FontSize="12"
-                        Foreground="#616469"
-                        LineHeight="20"
-                        Text="URL" />
-                    <StackPanel Orientation="Horizontal">
-                        <CustomControl:TextBoxWithTip
-                            x:Name="PageWebText"
-                            Width="228"
-                            Margin="16,0"
-                            VerticalContentAlignment="Center"
-                            IsEnabled="{Binding PageWebTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            IsError="{Binding ElementName=PageWebText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            PlaceHoldText="{Binding PageWebPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            ShowTip="{Binding ShowPageWebTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            Text="{Binding PageWebTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TipText="{Binding PageWebTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="LostFocus">
-                                    <i:InvokeCommandAction Command="{Binding PageWebTextLostFocusCommand}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                                <i:EventTrigger EventName="KeyDown">
-                                    <i:InvokeCommandAction Command="{Binding PageWebTextKeyDownCommand}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </CustomControl:TextBoxWithTip>
+
+                    <!--<StackPanel Name="LinkWebPanel" Visibility="{Binding ElementName=BtnLinkWeb, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
+                    <StackPanel Name="LinkWebPanel" Visibility="Collapsed">
+                        <TextBlock
+                            Height="20"
+                            Margin="16,12,0,4"
+                            FontFamily="Segoe UI"
+                            FontSize="12"
+                            Foreground="#616469"
+                            LineHeight="20"
+                            Text="URL" />
+                        <StackPanel Orientation="Horizontal">
+                            <CustomControl:TextBoxWithTip
+                                x:Name="PageWebText"
+                                Width="228"
+                                Margin="16,0"
+                                VerticalContentAlignment="Center"
+                                IsEnabled="{Binding PageWebTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                IsError="{Binding ElementName=PageWebText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                PlaceHoldText="{Binding PageWebPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                ShowTip="{Binding ShowPageWebTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                Text="{Binding PageWebTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                TipText="{Binding PageWebTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="LostFocus">
+                                        <i:InvokeCommandAction Command="{Binding PageWebTextLostFocusCommand}" PassEventArgsToCommand="True" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="KeyDown">
+                                        <i:InvokeCommandAction Command="{Binding PageWebTextKeyDownCommand}" PassEventArgsToCommand="True" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </CustomControl:TextBoxWithTip>
+                        </StackPanel>
                     </StackPanel>
-                </StackPanel>
-                <StackPanel Name="LinkMailPanel" Visibility="{Binding ElementName=BtnLinkMail, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">
-                    <TextBlock
-                        Height="20"
-                        Margin="16,12,0,4"
-                        FontFamily="Segoe UI"
-                        FontSize="12"
-                        Foreground="#616469"
-                        LineHeight="20"
-                        Text="Email" />
-                    <StackPanel Orientation="Horizontal">
-                        <CustomControl:TextBoxWithTip
-                            x:Name="PageMailText"
-                            Width="228"
-                            Margin="16,0"
-                            VerticalContentAlignment="Center"
-                            IsEnabled="{Binding PageMailTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            IsError="{Binding ElementName=PageMailText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            PlaceHoldText="{Binding PageMailPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            ShowTip="{Binding ShowPageMailTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            Text="{Binding PageMailTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            TipText="{Binding PageMailTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="LostFocus">
-                                    <i:InvokeCommandAction Command="{Binding PageMailTextLostFocusCommand}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                                <i:EventTrigger EventName="KeyDown">
-                                    <i:InvokeCommandAction Command="{Binding PageMailTextKeyDownCommand}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </CustomControl:TextBoxWithTip>
+                    <!--<StackPanel Name="LinkMailPanel" Visibility="{Binding ElementName=BtnLinkMail, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
+                    <StackPanel Name="LinkMailPanel" Visibility="Collapsed">
+                        <TextBlock
+                            Height="20"
+                            Margin="16,12,0,4"
+                            FontFamily="Segoe UI"
+                            FontSize="12"
+                            Foreground="#616469"
+                            LineHeight="20"
+                            Text="Email" />
+                        <StackPanel Orientation="Horizontal">
+                            <CustomControl:TextBoxWithTip
+                                x:Name="PageMailText"
+                                Width="228"
+                                Margin="16,0"
+                                VerticalContentAlignment="Center"
+                                IsEnabled="{Binding PageMailTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                IsError="{Binding ElementName=PageMailText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                PlaceHoldText="{Binding PageMailPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                ShowTip="{Binding ShowPageMailTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                Text="{Binding PageMailTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                TipText="{Binding PageMailTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="LostFocus">
+                                        <i:InvokeCommandAction Command="{Binding PageMailTextLostFocusCommand}" PassEventArgsToCommand="True" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="KeyDown">
+                                        <i:InvokeCommandAction Command="{Binding PageMailTextKeyDownCommand}" PassEventArgsToCommand="True" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </CustomControl:TextBoxWithTip>
+                        </StackPanel>
                     </StackPanel>
-                </StackPanel>
-            </Grid>
-            <Button
-                x:Name="BtnGOorBack"
-                Background="Transparent"
-                BorderThickness="0"
-                Command="{Binding BtnGOorBackPageCommand}"
-                Content="{Binding BtnGOorBackContent}"
-                FontSize="16"
-                Style="{StaticResource btn.link}"
-                Tag="GO"
-                Visibility="{Binding BtnGOorBackVisibility}">
-                <Button.CommandParameter>
-                    <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
-                        <MultiBinding.Bindings>
-                            <Binding ElementName="BtnGOorBack" />
-                            <Binding ElementName="BtnLinkPage" />
-                            <Binding ElementName="BtnLinkWeb" />
-                            <Binding ElementName="BtnLinkMail" />
-                        </MultiBinding.Bindings>
-                    </MultiBinding>
-                </Button.CommandParameter>
-            </Button>
+                </Grid>
+                <Button
+                    x:Name="BtnGOorBack"
+                    Background="Transparent"
+                    BorderThickness="0"
+                    Command="{Binding BtnGOorBackPageCommand}"
+                    Content="{Binding BtnGOorBackContent}"
+                    FontSize="16"
+                    Style="{StaticResource btn.link}"
+                    Tag="GO"
+                    Visibility="{Binding BtnGOorBackVisibility}">
+                    <Button.CommandParameter>
+                        <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
+                            <MultiBinding.Bindings>
+                                <Binding ElementName="BtnGOorBack" />
+                                <Binding ElementName="BtnLinkPage" />
+                                <Binding ElementName="BtnLinkWeb" />
+                                <Binding ElementName="BtnLinkMail" />
+                            </MultiBinding.Bindings>
+                        </MultiBinding>
+                    </Button.CommandParameter>
+                </Button>
+            </StackPanel>
+            <StackPanel
+                Name="EmptyPanel"
+                VerticalAlignment="Center"
+                Visibility="{Binding IsEmptyPanelVisibility}">
+                <Image
+                    Width="128"
+                    Height="128"
+                    Source="pack://application:,,,/Resources/PropertyPanel/no link.png" />
+                <TextBlock
+                    Name="txtEmpty"
+                    Margin="0,12,0,0"
+                    FontFamily="Segoe UI"
+                    FontSize="16"
+                    Text="{Binding T_EmptyTitle}"
+                    TextAlignment="Center" TextWrapping="Wrap" />
+            </StackPanel>
         </StackPanel>
     </Grid>
     <!--<i:Interaction.Triggers>