liyijie пре 2 година
родитељ
комит
fdd116debc

+ 57 - 1
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -117,6 +117,61 @@ namespace PDF_Office.ViewModels.FillAndSign
             }
 
 
+            //当不是注释模板,且无创建注释时,属性面板显示为空内容
+            if (isTemplateAnnot == false && annotArgs == null)
+            {
+                PDFViewer.SetMouseMode(MouseModes.PanTool);
+                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+            }
+            else
+            {
+                if (isSnapshotEdit == true)
+                {
+                    ShowPropertyPanel(false);
+                    isSnapshotEdit = false;
+                }
+                else
+                {
+                    ShowPropertyPanel(true);
+                }
+            }
+
+        }
+        private void InitCheckedEvent(string e)
+        {
+            IsEdit = false;
+    
+
+            //NavigateToProperty(control.Name);
+            //不创建注释,属于注释模板
+            bool isTemplateAnnot = false;
+            bool isSnapshotEdit = false;
+            AnnotHandlerEventArgs annotArgs = null;
+
+
+            var tag = e;
+            FindAnnotTypeKey(e, ref annotArgs);
+            if (e == "RbtnSign") { isTemplateAnnot = true; }
+
+
+            if (tag == "SnapshotEdit")
+            {
+                isSnapshotEdit = true;
+            }
+            else if (tag == "Signature" || tag == "Stamp")
+            {
+                isTemplateAnnot = true;
+            }
+
+            if (annotArgs != null)
+            {
+                annotArgs.Author = Settings.Default.AppProperties.Description.Author;
+                PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                PDFViewer.SetToolParam(annotArgs);
+                isRightMenuAddAnnot = false;
+            }
+
+
             //当不是注释模板,且无创建注释时,属性面板显示为空内容
             if (isTemplateAnnot == false && annotArgs == null)
             {
@@ -483,7 +538,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 
             }
 
-            if (annotAttribsList != null && annotAttribsList.Count != 0)
+            if (annotAttribsList != null && annotAttribsList.Count != 0&&annots != null && annots.Count != 0)
             {
                 if (annots.Count > 1)
                 {
@@ -1107,6 +1162,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             BindingPDFViewerHandler();
+            InitCheckedEvent("RbtnTick");
             IsEdit = false;
         }
         #endregion

+ 5 - 4
PDF Office/Views/FillAndSign/FillAndSignContent.xaml

@@ -15,17 +15,18 @@
     mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
-            <Style BasedOn="{StaticResource RectangleRadionButton}" TargetType="{x:Type RadioButton}">
+            <Style  BasedOn="{StaticResource SubToolbarRdb}" TargetType="{x:Type RadioButton}">
                 <Setter Property="Height" Value="36" />
                 <Setter Property="Width" Value="36" />
                 <Setter Property="Background" Value="Transparent" />
+
             </Style>
         </ResourceDictionary>
     </UserControl.Resources>
     <Border BorderBrush="#1A000000" BorderThickness="0,1,0,1">
         <Grid>
             <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
-                <RadioButton Name="RbtnText" IsChecked="True">
+                <!--<RadioButton Name="RbtnText" IsChecked="True">
                     <Path Data="M16.75 2.75V6H15.25V4.25H10.75V16H13V17.5H7V16H9.25V4.25H4.75V6H3.25V2.75H16.75Z" Fill="Black">
                         <Path.RenderTransform>
                             <TranslateTransform X="-2" />
@@ -36,8 +37,8 @@
                             <i:InvokeCommandAction Command="{Binding CheckCommand}" PassEventArgsToCommand="True" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
-                </RadioButton>
-                <RadioButton Name="RbtnTick">
+                </RadioButton>-->
+                <RadioButton Name="RbtnTick" IsChecked="True"  Width="36" Height="36">
                     <Path Data="M17.3725 3.20441L18.5688 4.10928L8.73555 17.1099L2.46973 10.844L3.53039 9.78337L8.57806 14.831L17.3725 3.20441Z" Fill="Black" />
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">