Kaynağa Gözat

其他-bug修复

OYXH\oyxh 2 yıl önce
ebeveyn
işleme
78c07f4696

+ 10 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -239,6 +239,16 @@ namespace PDF_Office.ViewModels.Tools
                 SetProperty(ref btnHandIsChecked, value);
             }
         }
+        private bool btnShowAnnotIsChecked = true;
+
+        public bool BtnShowAnnotIsChecked
+        {
+            get { return btnShowAnnotIsChecked; }
+            set
+            {
+                SetProperty(ref btnShowAnnotIsChecked, value);
+            }
+        }
 
         #endregion 注释工具
 

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

@@ -107,12 +107,10 @@ namespace PDF_Office.ViewModels.Tools
                 {
                     if (item is CustomIconToggleBtn customIconToggle)
                     {
-                        if (customIconToggle.Tag.ToString() != "ShowAnnot")
-                        {
-                            customIconToggle.IsChecked = false;
-                        }
+                        customIconToggle.IsChecked = false;
                     }
                 }
+                BtnShowAnnotIsChecked = true;
                 BtnHandIsChecked = true;
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
                 viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
@@ -131,7 +129,7 @@ namespace PDF_Office.ViewModels.Tools
             bool isSnapshotEdit = false;
             AnnotHandlerEventArgs annotArgs = null;
 
-            if(annotBtn.Name== "BtnShowAnnot")
+            if (annotBtn.Name == "BtnShowAnnot")
             {
                 PDFViewer.SetDrawAnnot((bool)annotBtn.IsChecked);
                 return;

+ 1 - 2
PDF Office/Views/Tools/AnnotToolContent.xaml

@@ -394,7 +394,7 @@
                     Click="BtnTool_Click"
                     Command="{Binding MyToolsCommand}"
                     CommandParameter="{Binding ElementName=BtnShowAnnot}"
-                    IsChecked="True"
+                    IsChecked="{Binding BtnShowAnnotIsChecked}"
                     Style="{StaticResource ToggleBtnViewModeStyle}"
                     Tag="ShowAnnot">
                     <Grid>
@@ -407,7 +407,6 @@
                             Stroke="#94989c"
                             StrokeThickness="2" />
                     </Grid>
-
                 </customControl:CustomIconToggleBtn>
             </WrapPanel>
         </Border>