Browse Source

编辑- 单击添加文本 ,新增刷新,避免卡顿出现 虚线框跑偏

OYXH\oyxh 1 year ago
parent
commit
26dd1ee698

+ 1 - 1
PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs

@@ -409,7 +409,7 @@ namespace PDF_Master.ViewModels.Tools
                     PDFViewer.SetPDFEditType(ComPDFKit.PDFPage.CPDFEditType.EditText);
 
                     PDFViewer.SetMouseMode(MouseModes.PDFEdit);
-                    //PDFViewer.ReloadDocument();
+                    PDFViewer.ReloadDocument();
                     PDFViewer.SetPDFEditCreateType(ComPDFKit.PDFPage.CPDFEditType.EditText);
                     //单击添加文本
                     PDFViewer.ToolManager.EnableClickCreate = true;

+ 7 - 3
PDF Office/Views/Tools/TextEditToolContent.xaml

@@ -7,7 +7,9 @@
     xmlns:local="clr-namespace:PDF_Master.Views.Tools"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
+    xmlns:viewmodels="clr-namespace:PDF_Master.ViewModels.Tools"
     Height="40"
+    d:DataContext="{d:DesignInstance Type=viewmodels:TextEditToolContentViewModel}"
     d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -15,7 +17,7 @@
     <Grid>
         <Border BorderBrush="{StaticResource color.sys.layout.divider}" BorderThickness="0,1,0,1">
             <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
-                <customControl:CustomIconToggleBtn IsChecked="{Binding IsTextEdit}"
+                <customControl:CustomIconToggleBtn
                     x:Name="BtnAddText"
                     Height="28"
                     Padding="4,0"
@@ -23,6 +25,7 @@
                     CommandParameter="{Binding ElementName=BtnAddText}"
                     ContentStringFormat="156"
                     Foreground="Black"
+                    IsChecked="{Binding IsTextEdit}"
                     Style="{StaticResource SubToolbarTgb}"
                     Tag="Text">
                     <StackPanel Orientation="Horizontal">
@@ -40,7 +43,7 @@
                             Text="Add Text" />
                     </StackPanel>
                 </customControl:CustomIconToggleBtn>
-                <customControl:CustomIconToggleBtn IsChecked="{Binding IsImgEdit}"
+                <customControl:CustomIconToggleBtn
                     x:Name="BtnAddImage"
                     Height="28"
                     Margin="8,0"
@@ -49,6 +52,7 @@
                     CommandParameter="{Binding ElementName=BtnAddImage}"
                     ContentStringFormat="156"
                     Foreground="{StaticResource color.icon.base.brand}"
+                    IsChecked="{Binding IsImgEdit}"
                     Style="{StaticResource SubToolbarTgb}"
                     Tag="Image">
                     <StackPanel Orientation="Horizontal">
@@ -58,9 +62,9 @@
                         </Grid>
                         <TextBlock
                             Margin="4,0,0,0"
+                            VerticalAlignment="Center"
                             FontFamily="Segoe UI"
                             FontSize="12"
-                            VerticalAlignment="Center"
                             Text="Add Image" />
                     </StackPanel>
                 </customControl:CustomIconToggleBtn>