Browse Source

综合-表单BUG修复

zhuyi 2 years ago
parent
commit
b13dc8da10

+ 27 - 0
PDF Office/DataConvert/ListCountToVisible.cs.cs

@@ -35,6 +35,33 @@ namespace PDF_Office.DataConvert
             throw new NotImplementedException();
             throw new NotImplementedException();
         }
         }
     }
     }
+    
+    public class MergeListCountToBool : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return false;
+            }
+            else
+            {
+                if ((int)value >=2)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
 
 
 
 
     public class ListCountAndBoolToVisible : IMultiValueConverter
     public class ListCountAndBoolToVisible : IMultiValueConverter

+ 14 - 0
PDF Office/ViewModels/BOTA/SearchContentViewModel.cs

@@ -121,6 +121,20 @@ namespace PDF_Office.ViewModels.BOTA
             {
             {
                 Completed = Visibility.Visible;
                 Completed = Visibility.Visible;
                 SearchCount = e.TotalCount.ToString();
                 SearchCount = e.TotalCount.ToString();
+                List<TextSearchItem> pageTextList = new List<TextSearchItem>();
+                foreach (var item in SearchItemList)
+                {
+                    TextSearchItem textSearchItem = new TextSearchItem()
+                    {
+                        PageIndex = item.TextProperty.PageIndex,
+                        TextRect = item.TextProperty.TextRect,
+                        TextContent = item.TextProperty.TextContent,
+                        PageRotate = item.TextProperty.PageRotate
+                    };
+                    textSearchItem.PaintBrush = new SolidColorBrush(Color.FromArgb(0x99, 0xFF, 0xF7, 0x00));
+                    pageTextList.Add(textSearchItem);
+                }
+                PDFViewer.SetPageSelectText(pageTextList);
             });
             });
         }
         }
 
 

+ 2 - 2
PDF Office/ViewModels/Dialog/SignatureCreateDialogViewModel.cs

@@ -215,7 +215,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
             }
         }
         }
 
 
-        private int thicknessListIndex = 0;
+        private int thicknessListIndex = 3;
 
 
         public int ThicknessListIndex
         public int ThicknessListIndex
         {
         {
@@ -253,7 +253,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             DrawingAttributeObject = new DrawingAttributes();
             DrawingAttributeObject = new DrawingAttributes();
             StrokesObject = new StrokeCollection();
             StrokesObject = new StrokeCollection();
             FontNameList = new ObservableCollection<string>();
             FontNameList = new ObservableCollection<string>();
-            ThicknessList = new ObservableCollection<string>() { "1.0pt", "2.0pt", "4.0pt", "6.0pt", "8.0pt" };//改了这里记得去改ThicknessListIndex的Set方法里面的取值
+            ThicknessList = new ObservableCollection<string>() {"0.5pt", "1.0pt", "1.5pt", "2.0pt", "2.5pt", "3.0pt" };//改了这里记得去改ThicknessListIndex的Set方法里面的取值
             CancelCommand = new DelegateCommand(Cancel);
             CancelCommand = new DelegateCommand(Cancel);
             CreateCommnad = new DelegateCommand(Create);
             CreateCommnad = new DelegateCommand(Create);
             CheckedCommnad = new DelegateCommand<object>(Checked);
             CheckedCommnad = new DelegateCommand<object>(Checked);

+ 9 - 9
PDF Office/Views/BOTA/SearchContent.xaml.cs

@@ -34,10 +34,10 @@ namespace PDF_Office.Views.BOTA
         const int MaxHistoryCount = 10;
         const int MaxHistoryCount = 10;
         private void TextBox_KeyDown(object sender, KeyEventArgs e)
         private void TextBox_KeyDown(object sender, KeyEventArgs e)
         {
         {
-            if (e.Key==Key.Enter)
+            if (e.Key == Key.Enter)
             {
             {
                 TextBox text = e.Source as TextBox;
                 TextBox text = e.Source as TextBox;
-                if (text==null)
+                if (text == null)
                 {
                 {
                     return;
                     return;
                 }
                 }
@@ -46,12 +46,12 @@ namespace PDF_Office.Views.BOTA
                     return;
                     return;
                 }
                 }
                 (DataContext as SearchContentViewModel).SearchText(text.Text);
                 (DataContext as SearchContentViewModel).SearchText(text.Text);
-                 HistorySearchText.Remove(text.Text);
+                HistorySearchText.Remove(text.Text);
                 if (HistorySearchText.Count >= MaxHistoryCount)
                 if (HistorySearchText.Count >= MaxHistoryCount)
                 {
                 {
-                    HistorySearchText.RemoveAt(0);
+                    HistorySearchText.RemoveAt(HistorySearchText.Count - 1);
                 }
                 }
-                HistorySearchText.Add(text.Text);
+                HistorySearchText.Insert(0, text.Text);
             }
             }
         }
         }
 
 
@@ -70,7 +70,7 @@ namespace PDF_Office.Views.BOTA
                 foreach (object item2 in item.Items)
                 foreach (object item2 in item.Items)
                 {
                 {
                     SearchItem searchItem = item2 as SearchItem;
                     SearchItem searchItem = item2 as SearchItem;
-                    if (searchItem.TextProperty.ItemVisibility==Visibility.Visible)
+                    if (searchItem.TextProperty.ItemVisibility == Visibility.Visible)
                     {
                     {
                         searchItem.TextProperty.ItemVisibility = Visibility.Collapsed;
                         searchItem.TextProperty.ItemVisibility = Visibility.Collapsed;
                     }
                     }
@@ -84,8 +84,8 @@ namespace PDF_Office.Views.BOTA
 
 
         private void Create_Click(object sender, RoutedEventArgs e)
         private void Create_Click(object sender, RoutedEventArgs e)
         {
         {
-            MenuItem menuItem= sender as MenuItem;
-            if (menuItem==null)
+            MenuItem menuItem = sender as MenuItem;
+            if (menuItem == null)
             {
             {
                 return;
                 return;
             }
             }
@@ -139,7 +139,7 @@ namespace PDF_Office.Views.BOTA
                 ContextSearchText.Items.Add(Searchitem);
                 ContextSearchText.Items.Add(Searchitem);
             }
             }
 
 
-            if (HistorySearchText.Count>0)
+            if (HistorySearchText.Count > 0)
             {
             {
                 ContextSearchText.Items.Add(ClearSeparator);
                 ContextSearchText.Items.Add(ClearSeparator);
                 ContextSearchText.Items.Add(ClearItem);
                 ContextSearchText.Items.Add(ClearItem);

+ 3 - 2
PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml

@@ -16,6 +16,7 @@
         <dataconvert:BoolToVisible x:Key="BoolToVisible" />
         <dataconvert:BoolToVisible x:Key="BoolToVisible" />
         <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
         <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
         <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
         <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
+        <dataconvert:MergeListCountToBool x:Key="MergeListCountToBool"/>
         <dataconvert:UnVisibleToBoolConvert x:Key="UnVisibleToBoolConvert"/>
         <dataconvert:UnVisibleToBoolConvert x:Key="UnVisibleToBoolConvert"/>
         <PathGeometry x:Key="Ic_ClearButtonPath" Figures="M6 1.75H10V0.25H6V1.75ZM1 4.25H2.25V15C2.25 15.4142 2.58579 15.75 3 15.75H13C13.4142 15.75 13.75 15.4142 13.75 15V4.25H15V2.75H1V4.25ZM3.75 14.25V4.25H12.25V14.25H3.75ZM7.25 6.5V11.5H8.75V6.5H7.25Z" />
         <PathGeometry x:Key="Ic_ClearButtonPath" Figures="M6 1.75H10V0.25H6V1.75ZM1 4.25H2.25V15C2.25 15.4142 2.58579 15.75 3 15.75H13C13.4142 15.75 13.75 15.4142 13.75 15V4.25H15V2.75H1V4.25ZM3.75 14.25V4.25H12.25V14.25H3.75ZM7.25 6.5V11.5H8.75V6.5H7.25Z" />
         <PathGeometry x:Key="Ic_DeleteButtonPath" Figures="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.5303 5.53038L9.06069 8L11.5303 10.4696L10.4697 11.5303L8.00002 9.06066L5.53033 11.5303L4.46967 10.4697L6.93936 8L4.46967 5.53033L5.53033 4.46967L8.00002 6.93934L10.4697 4.46971L11.5303 5.53038Z" />
         <PathGeometry x:Key="Ic_DeleteButtonPath" Figures="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.5303 5.53038L9.06069 8L11.5303 10.4696L10.4697 11.5303L8.00002 9.06066L5.53033 11.5303L4.46967 10.4697L6.93936 8L4.46967 5.53033L5.53033 4.46967L8.00002 6.93934L10.4697 4.46971L11.5303 5.53038Z" />
@@ -268,7 +269,7 @@
         </Border>
         </Border>
 
 
         <StackPanel Grid.Column="1" Grid.Row="5"  Orientation="Horizontal" HorizontalAlignment="Right">
         <StackPanel Grid.Column="1" Grid.Row="5"  Orientation="Horizontal" HorizontalAlignment="Right">
-            <Button x:Name="BtnMerge" Width="118" Content="Merge"  Height="32" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}" IsEnabled="{Binding ElementName=NoFileStackPanel,Path=Visibility,Converter={StaticResource UnVisibleToBoolConvert}}"/>
+            <Button x:Name="BtnMerge" Width="118" Content="Merge"  Height="32" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}" IsEnabled="{Binding MergeObjectlist.Count, Converter={StaticResource MergeListCountToBool}}"/>
             <Button x:Name="BtnCancel" Margin="16,0,0,0" Width="118" Content="Cancel" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
             <Button x:Name="BtnCancel" Margin="16,0,0,0" Width="118" Content="Cancel" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
         </StackPanel>
         </StackPanel>
         <StackPanel  Grid.Column="1" Grid.Row="5" Orientation="Horizontal" >
         <StackPanel  Grid.Column="1" Grid.Row="5" Orientation="Horizontal" >
@@ -284,7 +285,7 @@
                     </i:EventTrigger>
                     </i:EventTrigger>
                 </i:Interaction.Triggers>
                 </i:Interaction.Triggers>
             </ComboBoxItem>
             </ComboBoxItem>
-            <ComboBoxItem Tag="1" Visibility="Collapsed">
+            <ComboBoxItem Tag="1">
                 <TextBlock  Text="添加文件夹"/>
                 <TextBlock  Text="添加文件夹"/>
                 <i:Interaction.Triggers>
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="PreviewMouseUp">
                     <i:EventTrigger EventName="PreviewMouseUp">