Ver Fonte

页面编辑-插入文件 支持插入格式:PDF、图片、Office格式文件,UI优化

OYXH\oyxh há 1 ano atrás
pai
commit
bad07d8c6b

+ 31 - 0
PDF Office/DataConvert/BoolToFontSizeConverter.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Master.DataConvert
+{
+    public class BoolToFontSizeConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if ((bool)value)
+            {
+                return 12;
+            }
+            else
+            {
+                return 14;
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 13 - 0
PDF Office/Model/PageEdit/PageEditItem.cs

@@ -98,6 +98,19 @@ namespace PDF_Master.Model.PageEdit
             }
         }
 
+        private bool isBOTAThumb=false;
+
+        public bool IsBOTAThumb
+        {
+            get { return isBOTAThumb; }
+            set
+            {
+                SetProperty(ref isBOTAThumb, value);
+            }
+        }
+
+
+
         private bool haveBookMark = false;
         /// <summary>
         /// 该页是否有书签标记

+ 4 - 0
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -460,6 +460,10 @@
           <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
           <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
         </trans-unit>
+        <trans-unit id="pdf" translate="yes" xml:space="preserve">
+          <source>*.pdf;</source>
+          <target state="new">*.pdf;</target>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 4 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -460,6 +460,10 @@
           <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
           <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
         </trans-unit>
+        <trans-unit id="pdf" translate="yes" xml:space="preserve">
+          <source>*.pdf;</source>
+          <target state="new">*.pdf;</target>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 4 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -460,6 +460,10 @@
           <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
           <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
         </trans-unit>
+        <trans-unit id="pdf" translate="yes" xml:space="preserve">
+          <source>*.pdf;</source>
+          <target state="new">*.pdf;</target>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 1 - 0
PDF Office/PDF Master.csproj

@@ -352,6 +352,7 @@
     </Compile>
     <Compile Include="DataConvert\AnnotateFontSizeConverter.cs" />
     <Compile Include="DataConvert\BoolToBrushConvert.cs" />
+    <Compile Include="DataConvert\BoolToFontSizeConverter.cs" />
     <Compile Include="DataConvert\BoolToTextWrapConvert.cs" />
     <Compile Include="DataConvert\CenterToolTipConverter .cs" />
     <Compile Include="DataConvert\ColorBrushConvert.cs" />

+ 12 - 3
PDF Office/Properties/Resources.Designer.cs

@@ -19,7 +19,7 @@ namespace PDF_Master.Properties {
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
     // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     internal class Resources {
@@ -96,6 +96,15 @@ namespace PDF_Master.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找类似 *.pdf; 的本地化字符串。
+        /// </summary>
+        internal static string pdf {
+            get {
+                return ResourceManager.GetString("pdf", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 *.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm; 的本地化字符串。
         /// </summary>
@@ -107,8 +116,8 @@ namespace PDF_Master.Properties {
         
         /// <summary>
         ///   查找类似 &lt;Lisences
-        ///    devKey = &quot;BYAm61De27VtCV+WwCzs+IxatlXahRQ894cp5zIJcNoy4S+u6QppBNrYoVcjU4TPKR9DDYI8qIMvbFC8aA7TOyGh1e5tRipgo4YJ48cJ1Z4B/DTm6zsIr5jM9igrURcLn49YTdeImf1nNhwTm9xkegp3gFoGfVhv5I7xHR517kQ=&quot;
-        ///  devSecret = &quot;mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnRzqdOnX7x2+q8tWByiVc2g+bTR9XTCabBT78l+Iey7cmsKlSJ3WFqmDWhwfT73yCYDNQpuarUAQxiS1PJu8kUw==&quot;	userKey = &quot;iBPR [字符串的其余部分被截断]&quot;; 的本地化字符串。
+        ///    devKey = &quot;MR+QexuegNeqiBQsqcIcFzDeioHWjwb2vjDGnbooRo2BeTSWnmGnqHt8tHPlZxRRinYCeuW5DqGFyKcFfMVXAsip0AFj42LhYS9KBFus5kgXzOn+ZcLVFm1an4fKnn6ShRXnUWaemHBeaMzLbFEPbz6jDFFoIizuCMHP6KFf/6o=&quot;
+        ///    devSecret = &quot;mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnkBnoGhqnvZdAqbtp5o0JTKDl1EzWv/F/0Gw7Q02pypAMFoEMtjKxkVmy+liLW9u9&quot;	userSecret=&quot;mG0c3O3Mzeu5dkZJW3gpqq9uA [字符串的其余部分被截断]&quot;; 的本地化字符串。
         /// </summary>
         internal static string SDKLisence {
             get {

+ 3 - 0
PDF Office/Properties/Resources.resx

@@ -131,6 +131,9 @@
   <data name="OpenDialogFilter" xml:space="preserve">
     <value>PDF Files (*.pdf)|*.pdf</value>
   </data>
+  <data name="pdf" xml:space="preserve">
+    <value>*.pdf;</value>
+  </data>
   <data name="pptex" xml:space="preserve">
     <value>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</value>
     <comment>支持的ppt文档文件格式</comment>

+ 4 - 2
PDF Office/Themes/Generic.xaml

@@ -19,8 +19,10 @@
                                 <TextBlock
                                     Margin="16,0"
                                     VerticalAlignment="Center"
+                                    FontFamily="Segoe UI"
                                     FontSize="16"
-                                    FontWeight="SemiBold"
+                                    FontWeight="Bold"
+                                    Foreground="{StaticResource color.sys.text.neutral.lv1}"
                                     Text="{TemplateBinding Header}" />
                             </Border>
                             <ContentPresenter
@@ -48,7 +50,7 @@
         <Setter Property="BorderThickness" Value="1" />
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />
         <Setter Property="Height" Value="32" />
-        <Setter Property="Padding" Value="3 0"/>
+        <Setter Property="Padding" Value="3,0" />
         <Setter Property="CornerRadius" Value="4" />
         <Setter Property="Template">
             <Setter.Value>

Diff do ficheiro suprimidas por serem muito extensas
+ 2186 - 1931
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs


+ 127 - 24
PDF Office/Views/Dialog/PageEditDialogs/InsertDialog.xaml

@@ -11,16 +11,56 @@
     xmlns:model="clr-namespace:PDF_Master.Model.PageEdit"
     xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
     xmlns:prism="http://prismlibrary.com/"
-    Width="380"
+    Width="468"
     Height="350"
     d:DataContext="{d:DesignInstance Type=pageeditdialogs:InsertDialogViewModel}"
-    d:DesignHeight="450"
-    d:DesignWidth="800"
+    d:DesignHeight="350"
+    d:DesignWidth="468"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
     <UserControl.Resources>
+
         <ResourceDictionary>
+            <Style x:Key="TextBoxStyle" TargetType="TextBox">
+                <Setter Property="Height" Value="32" />
+                <Setter Property="FontSize" Value="14" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="TextBox">
+                            <Border
+                                x:Name="border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="5"
+                                SnapsToDevicePixels="True">
+                                <!--<TextBox
+                                Name="markText"
+                                VerticalAlignment="Center"
+                                Background="Transparent"
+                                BorderBrush="Transparent"
+                                FontSize="12"
+                                Text="{TemplateBinding Text}"
+                                Visibility="Visible" />-->
+                            </Border>
+
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="IsEnabled" Value="false">
+                                    <Setter TargetName="border" Property="Opacity" Value="0.56" />
+                                    <Setter TargetName="border" Property="Background" Value="{StaticResource color.field.bg.dis}" />
+                                </Trigger>
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
+                                </Trigger>
+                                <Trigger Property="IsKeyboardFocused" Value="true">
+                                    <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
             <convert:FileToImageSourceConvert x:Key="FileToImageSourceConvert" />
             <DataTemplate x:Key="CustomItem" DataType="{x:Type model:CustomPageItem}">
                 <StackPanel HorizontalAlignment="Center">
@@ -68,7 +108,8 @@
                     BorderThickness="0"
                     ItemTemplate="{StaticResource CustomItem}"
                     ItemsSource="{Binding Pages}"
-                    SelectedIndex="{Binding ItemSelectedIndex, Mode=TwoWay}" Visibility="Hidden">
+                    SelectedIndex="{Binding ItemSelectedIndex, Mode=TwoWay}"
+                    Visibility="Hidden">
                     <ListBox.ItemContainerStyle>
                         <Style TargetType="{x:Type ListBoxItem}">
                             <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
@@ -81,35 +122,42 @@
                         </ItemsPanelTemplate>
                     </ListBox.ItemsPanel>
                 </ListBox>
-                <StackPanel Grid.Row="0" Margin="16,0">
+                <StackPanel Grid.Row="0" Margin="16,10">
                     <TextBlock
-                        FontSize="14"
+                        FontFamily="Segoe UI"
+                        FontSize="12"
                         FontWeight="SemiBold"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
                         Text="页面大小" />
                     <StackPanel
-                        Margin="0,12,0,0"
+                        Margin="0,10"
                         VerticalAlignment="Bottom"
                         Orientation="Horizontal">
                         <RadioButton
                             Height="32"
                             VerticalContentAlignment="Center"
                             Content="当前页"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
                             GroupName="PageSize"
-                            IsEnabled="{Binding IsCurrentIsEnabled,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
-                            IsChecked="{Binding IsCurrentSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                            IsChecked="{Binding IsCurrentSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                            IsEnabled="{Binding IsCurrentIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                         <Label
                             Height="32"
                             Margin="8,0"
                             HorizontalAlignment="Center"
                             VerticalContentAlignment="Center"
                             Content="{Binding CurrentPageSize}"
+                            FontFamily="Segoe UI"
                             FontSize="14" />
                     </StackPanel>
-                    <StackPanel Margin="0,12" Orientation="Horizontal">
+                    <StackPanel Margin="0,10" Orientation="Horizontal">
                         <RadioButton
                             Name="RbtnStandard"
                             VerticalAlignment="Center"
                             Content="标准"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
                             GroupName="PageSize"
                             IsChecked="{Binding IsStandSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                         <ComboBox
@@ -120,30 +168,77 @@
                             ItemsSource="{Binding PageSize}"
                             SelectedIndex="{Binding PageSizeSelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     </StackPanel>
-                    <StackPanel Margin="0,0,0,12" Orientation="Horizontal">
+                    <StackPanel Margin="0,10" Orientation="Horizontal">
                         <RadioButton
                             Name="RbtnCustom"
                             VerticalAlignment="Center"
                             Content="自定义"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
                             GroupName="PageSize"
                             IsChecked="{Binding IsCustomSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                        <!--<TextBox
+                        Width="94"
+                        Height="32"
+                        Margin="8,0"
+                        VerticalContentAlignment="Center"
+                        IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
+                        Style="{StaticResource TextBoxStyle}"
+                        Text="{Binding CustomWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
                         <TextBox
-                            Width="80"
+                            Width="94"
                             Height="32"
                             Margin="8,0"
+                            Padding="8,0"
+                            HorizontalContentAlignment="Left"
                             VerticalContentAlignment="Center"
+                            Background="{StaticResource color.field.bg.def}"
+                            BorderBrush="{StaticResource color.field.border.norm}"
+                            InputMethod.IsInputMethodEnabled="False"
                             IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
-                            Text="{Binding CustomWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                        <TextBlock VerticalAlignment="Center" Text="X" />
+                            Text="{Binding CustomWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                            <TextBox.Resources>
+                                <Style TargetType="{x:Type Border}">
+                                    <Setter Property="CornerRadius" Value="4" />
+
+
+
+                                </Style>
+                            </TextBox.Resources>
+                        </TextBox>
+                        <TextBlock
+                            VerticalAlignment="Center"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
+                            Text="X" />
+                        <!--<TextBox
+                        Width="80"
+                        Height="32"
+                        Margin="8,0"
+                        VerticalContentAlignment="Center"
+                        IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
+                        Text="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
                         <TextBox
-                            Width="80"
+                            Width="94"
                             Height="32"
                             Margin="8,0"
+                            Padding="8,0"
+                            HorizontalContentAlignment="Left"
                             VerticalContentAlignment="Center"
+                            Background="{StaticResource color.field.bg.def}"
+                            BorderBrush="{StaticResource color.field.border.norm}"
+                            InputMethod.IsInputMethodEnabled="False"
                             IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
-                            Text="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
+                            Text="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
+                            <TextBox.Resources>
+                                <Style TargetType="{x:Type Border}">
+                                    <Setter Property="CornerRadius" Value="4" />
+                                </Style>
+                            </TextBox.Resources>
+                        </TextBox>
                         <ComboBox
-                            Width="80"
+                            Width="94"
+                            Margin="8,0"
                             VerticalContentAlignment="Center"
                             IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
                             ItemsSource="{Binding Units}"
@@ -152,22 +247,30 @@
                 </StackPanel>
                 <StackPanel Grid.Row="1" Margin="16,0">
                     <TextBlock
-                        FontSize="14"
+                        FontFamily="Segoe UI"
+                        FontSize="12"
                         FontWeight="SemiBold"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
                         Text="方向" />
                     <StackPanel Orientation="Horizontal">
                         <RadioButton
+                            Width="86"
                             Margin="0,12,0,16"
                             Content="纵向页面"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
+                            GroupName="Direction"
                             IsChecked="{Binding IsVerticalSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            Tag="Vertical"
-                            GroupName="Direction"/>
+                            Tag="Vertical" />
                         <RadioButton
-                            Margin="24,12,0,16"
+                            Width="86"
+                            Margin="30,12,0,16"
                             Content="横向页面"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
+                            GroupName="Direction"
                             IsChecked="{Binding IsHorizontalSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                            Tag="Horizontal"
-                            GroupName="Direction"/>
+                            Tag="Horizontal" />
                     </StackPanel>
                 </StackPanel>
             </Grid>
@@ -191,4 +294,4 @@
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>
-</UserControl>
+</UserControl>

+ 65 - 26
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -31,6 +31,7 @@
         <ResourceDictionary>
             <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
             <convert:UnVisivleConvert x:Key="UnVisibleConvert" />
+            <convert:BoolToFontSizeConverter x:Key="BoolToFontSizeConverter" />
             <DataTemplate x:Key="PageEditListBoxItemTemplate" DataType="{x:Type pageedit:PageEditItem}">
                 <Grid Name="BdRoot">
                     <StackPanel AllowDrop="True">
@@ -87,7 +88,7 @@
                                     MinHeight="22"
                                     MaxWidth="{Binding ElementName=GridRoot, Path=ActualWidth}"
                                     HorizontalAlignment="Center"
-                                    FontSize="14"
+                                    FontSize="{Binding IsBOTAThumb,Converter={StaticResource BoolToFontSizeConverter}}"
                                     Text="{Binding PageSize}"
                                     TextWrapping="Wrap"
                                     Visibility="{Binding ShowPageSize, Converter={StaticResource BoolToVisibleConvert}}" />
@@ -119,7 +120,7 @@
                 <MenuItem
                     Command="{Binding ReplaceCommand}"
                     Header="替换页面"
-                    Visibility="{Binding IsBOTAThumb,Converter={StaticResource UnvisibleConvert}}" />
+                    Visibility="{Binding IsBOTAThumb, Converter={StaticResource UnvisibleConvert}}" />
                 <MenuItem Command="{Binding DeleteCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuDelete}" />
                 <MenuItem
                     Command="{Binding EnterPageEditCommand}"
@@ -243,34 +244,72 @@
                         BorderBrush="#33000000"
                         BorderThickness="5"
                         Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-                    <Menu
-                        Width="65"
-                        Height="20"
-                        Margin="5"
+                    <!--<Menu
+                    Width="65"
+                    Height="20"
+                    Margin="5"
+                    Visibility="Visible">
+                    <MenuItem
+                    Width="65"
+                    Height="20"
+                    Header="插入">
+                    <MenuItem
+                    Command="{Binding InsertCommand}"
+                    CommandParameter="{x:Static model:ParameterNames.InsertType_File}"
+                    Header="插入文件" />
+                    <MenuItem
+                    Command="{Binding InsertCommand}"
+                    CommandParameter="{x:Static model:ParameterNames.InsertType_Blank}"
+                    Header="插入空白页" />
+                    <MenuItem
+                    Command="{Binding InsertCommand}"
+                    CommandParameter="{x:Static model:ParameterNames.InsertType_Custom}"
+                    Header="插入自定义页面" />
+                    </MenuItem>
+                    </Menu>-->
+                    <Button
+                        Name="BtnInsert"
+                        Click="BtnInsert_Click"
+                        Initialized="BtnInsert_Initialized"
+                        Style="{StaticResource InsideBarBtnStyle}"
                         Visibility="Visible">
-                        <MenuItem
-                            Width="65"
-                            Height="20"
-                            Header="插入">
-                            <MenuItem
-                                Command="{Binding InsertCommand}"
-                                CommandParameter="{x:Static model:ParameterNames.InsertType_File}"
-                                Header="插入文件" />
-                            <MenuItem
-                                Command="{Binding InsertCommand}"
-                                CommandParameter="{x:Static model:ParameterNames.InsertType_Blank}"
-                                Header="插入空白页" />
-                            <MenuItem
-                                Command="{Binding InsertCommand}"
-                                CommandParameter="{x:Static model:ParameterNames.InsertType_Custom}"
-                                Header="插入自定义页面" />
-                        </MenuItem>
-                    </Menu>
+                        <StackPanel Margin="4,0,4,0" Orientation="Horizontal">
+                            <Grid Margin="0,0,6,0">
+
+                                <Path Data="M10.5 18H4.5V2H12.3671L16.5 6.74847V10H18.5V6.74847C18.5 6.26584 18.3255 5.79948 18.0086 5.43542L13.8757 0.686951C13.4958 0.250541 12.9456 0 12.3671 0H4.5C3.39543 0 2.5 0.895431 2.5 2V18C2.5 19.1046 3.39543 20 4.5 20H10.5V18Z " Fill="#273C62" />
+                                <Path Data="M16.5 14V11H14.5V14H11.5V16H14.5V19H16.5V16H19.5V14H16.5Z " Fill="#94989C" />
+                            </Grid>
+                            <TextBlock VerticalAlignment="Center" Text="插入" />
+                            <Path
+                                Width="12"
+                                Height="12"
+                                Margin="3,0,0,0"
+                                Data="M6.5 10L11.5 4H1.5L6.5 10Z"
+                                Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+                        </StackPanel>
+                        <Button.ContextMenu>
+                            <ContextMenu Name="MenuInsert" Placement="Bottom">
+                                <MenuItem
+                                    Command="{Binding InsertCommand}"
+                                    CommandParameter="{x:Static model:ParameterNames.InsertType_File}"
+                                    Header="插入文件" />
+                                <MenuItem
+                                    Command="{Binding InsertCommand}"
+                                    CommandParameter="{x:Static model:ParameterNames.InsertType_Blank}"
+                                    Header="插入空白页" />
+                                <MenuItem
+                                    Command="{Binding InsertCommand}"
+                                    CommandParameter="{x:Static model:ParameterNames.InsertType_Custom}"
+                                    Header="插入自定义页面" />
+                            </ContextMenu>
+                        </Button.ContextMenu>
+                    </Button>
                     <Button
                         Margin="5"
                         Command="{Binding ExtractCommand}"
                         Content="提取"
                         Visibility="Visible" />
+
                     <Button
                         Margin="5"
                         Command="{Binding ReplaceCommand}"
@@ -480,13 +519,13 @@
                 Visibility="{Binding ShowTip, Mode=TwoWay}"
                 Duration="0:0:0:3" />
 
-            <!--<ProgressBar
+            <ProgressBar
             Grid.Row="1"
             Width="400"
             Height="10"
             Foreground="Blue"
             IsIndeterminate="True"
-            Visibility="{Binding IsLoading}" />-->
+            Visibility="{Binding IsLoading}" />
         </Grid>
     </Border>
 </UserControl>

+ 14 - 2
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -483,6 +483,8 @@ namespace PDF_Master.Views.PageEdit
                 }
                 RectChoose.Visibility = Visibility.Collapsed;
                 startChoose = false;
+                LineInset.Visibility = Visibility.Collapsed;
+                ImgPicture.Visibility = Visibility.Collapsed;
                 Mouse.Capture(null);
             }
             catch
@@ -724,7 +726,7 @@ namespace PDF_Master.Views.PageEdit
 
             List<ListBoxItem> list = new List<ListBoxItem>();
             List<int> sourceindex = new List<int>();//需要保存每个页面对应的位置
-            //开始排序
+                                                    //开始排序
             List<int> pages = new List<int>();
             //要先对所有选中项 根据页码排序
             for (int i = 0; i < ListPageEdit.SelectedItems.Count; i++)
@@ -1096,7 +1098,6 @@ namespace PDF_Master.Views.PageEdit
 
         private void Grid_Drop(object sender, DragEventArgs e)
         {
-
             DragDropHelper.Drop(this, e);
         }
 
@@ -1223,5 +1224,16 @@ namespace PDF_Master.Views.PageEdit
             Regex regex = new Regex("[^0-9,-]+"); // 限制仅允许数字、逗号和横杠
             e.Handled = regex.IsMatch(e.Text);
         }
+
+        private void BtnInsert_Initialized(object sender, EventArgs e)
+        {
+            this.BtnInsert.ContextMenu = null;
+        }
+
+        private void BtnInsert_Click(object sender, RoutedEventArgs e)
+        {
+            MenuInsert.PlacementTarget = this.BtnInsert;
+            MenuInsert.IsOpen = true;
+        }
     }
 }