Browse Source

编辑PDF - 添加编辑PDF文件

chenrongqian 2 years ago
parent
commit
330d070404

+ 16 - 8
PDF Office/PDF Office.csproj

@@ -334,6 +334,7 @@
     <Compile Include="ViewModels\HomePanel\RecentFiles\RecentFilesContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\CustomCreateDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\DynamicPropertyDialogViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\TextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
@@ -383,7 +384,6 @@
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SharpsAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\StampAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\TextAnnotPropertyViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\TextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PropertyPanelContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadModeContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\SplitScreenContentViewModel.cs" />
@@ -392,6 +392,7 @@
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Function.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Properties.cs" />
+    <Compile Include="ViewModels\Tools\TextEditToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\ToolsBarContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateBaseContentViewModel.cs" />
@@ -662,15 +663,15 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\TextAnnotProperty.xaml.cs">
       <DependentUpon>TextAnnotProperty.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\TextEditProperty.xaml.cs">
-      <DependentUpon>TextEditProperty.xaml</DependentUpon>
-    </Compile>
     <Compile Include="CustomControl\CompositeControl\SlidContent.xaml.cs">
       <DependentUpon>SlidContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\PropertyPanelContent.xaml.cs">
       <DependentUpon>PropertyPanelContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\TextEditProperty.xaml.cs">
+      <DependentUpon>TextEditProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml.cs">
       <DependentUpon>ReadModeContent.xaml</DependentUpon>
     </Compile>
@@ -689,6 +690,9 @@
     <Compile Include="Views\Tools\ConverterBarContent.xaml.cs">
       <DependentUpon>ConverterBarContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Tools\TextEditToolContent.xaml.cs">
+      <DependentUpon>TextEditToolContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\ToolsBarContent.xaml.cs">
       <DependentUpon>ToolsBarContent.xaml</DependentUpon>
     </Compile>
@@ -1078,10 +1082,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\TextEditProperty.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Views\EditTools\Watermark\WatermarkTemplateListBaseContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1104,6 +1104,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\TextEditProperty.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1214,6 +1218,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Tools\TextEditToolContent.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\Tools\ToolsBarContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 0 - 12
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextEditPropertyViewModel.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
-{
-    internal class TextEditPropertyViewModel
-    {
-    }
-}

+ 32 - 0
PDF Office/ViewModels/PropertyPanel/TextEditPropertyViewModel.cs

@@ -0,0 +1,32 @@
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.PropertyPanel
+{
+    public class TextEditPropertyViewModel : BindableBase, INavigationAware
+    {
+        public TextEditPropertyViewModel()
+        {
+
+        }
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Tools
+{
+    public class TextEditToolContentViewModel: BindableBase
+    {
+        public DelegateCommand<object> AddContentCommand { get; set; }
+        public TextEditToolContentViewModel()
+        {
+            AddContentCommand = new DelegateCommand<object>(AddContent);
+        }
+
+        public void AddContent(object obj)
+        {
+           
+        }
+
+    }
+}

+ 7 - 0
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -456,6 +456,13 @@ namespace PDF_Office.ViewModels
                 case "TabItemForm":
                 case "TabItemEdit":
                     ToolsBarContentVisible = Visibility.Visible;
+                    if(currentBar == "TabItemEdit")
+                    {
+                        IsPropertyOpen = !IsPropertyOpen;
+                        if(IsPropertyOpen == true)
+                        SelectedPrpoertyPanel("TextEditProperty", null);
+                    }
+                    
                     break;
 
                 case "TabItemConvert":

+ 0 - 12
PDF Office/Views/PropertyPanel/AnnotPanel/TextEditProperty.xaml

@@ -1,12 +0,0 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.TextEditProperty"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
-</UserControl>

+ 346 - 0
PDF Office/Views/PropertyPanel/TextEditProperty.xaml

@@ -0,0 +1,346 @@
+<UserControl x:Class="PDF_Office.Views.PropertyPanel.TextEditProperty"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Styles/SliderStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+
+            <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
+            <Style x:Key="line1Style" TargetType="{x:Type Line}">
+                <Setter Property="Visibility">
+                    <Setter.Value>
+                        <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
+                            <Binding ElementName="TextAlignLeftBtn" Path="IsChecked"/>
+                            <Binding ElementName="TextAlignCenterBtn" Path="IsChecked"/>
+                        </MultiBinding>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+            <Style x:Key="line2Style" TargetType="{x:Type Line}">
+                <Setter Property="Visibility">
+                    <Setter.Value>
+                        <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
+                            <Binding ElementName="TextAlignCenterBtn" Path="IsChecked"/>
+                            <Binding ElementName="TextAlignRightBtn" Path="IsChecked"/>
+                        </MultiBinding>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+
+            <ContextMenu x:Key="BtnFlyoutMenu" FontSize="14"
+                        >
+                <ContextMenu.ItemContainerStyle>
+                    <Style TargetType="MenuItem">
+                        <Setter Property="Padding" Value="0,7,0,7"/>
+                        <Setter Property="VerticalContentAlignment" Value="Center"/>
+                    </Style>
+                </ContextMenu.ItemContainerStyle>
+                <MenuItem Name="ChangeStyleMenuItem"  Header="用所选部分重新定义" IsEnabled="True">
+                </MenuItem>
+                <MenuItem Name="BackStyleMenuItem"  Header="恢复默认预设样式" IsEnabled="True">
+                </MenuItem>
+            </ContextMenu>
+
+            <DataTemplate x:Key="FontStyleData">
+                <Grid >
+                    <TextBlock Text="{Binding mFontStyleName}" Foreground="Black"/>
+                </Grid>
+            </DataTemplate>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid Background="#F3F3F3">
+        <StackPanel>
+            <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
+            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+                <Grid>
+                    <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5"
+                            Opacity="{Binding FillOpacity}"
+                            Background="{Binding FillColor}">
+                        <TextBlock Name="SampleText"
+                                   Foreground="{Binding SelectColor}" 
+                                   FontFamily="{Binding TextFontFamily}"
+                                   FontWeight="{Binding TextFontWeights}" 
+                                   FontStyle="{Binding TextFontStyle}"
+                                   FontSize="{Binding TextFontSize}" Opacity="{Binding FillOpacity}"
+                                   Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
+                        </TextBlock>
+                    </Border>
+
+                    <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
+                        <Path.Data>
+                            <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
+                        </Path.Data>
+                    </Path>
+                    <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
+                        <Path.Data>
+                            <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
+                        </Path.Data>
+                    </Path>
+                    <Path Name="SquigglyPath"  HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
+
+                    </Path>
+                </Grid>
+            </Border>
+
+
+            <Border BorderBrush="#E2E3E6"  Height="32" Margin="12,0,4,0"  BorderThickness="0">
+                <StackPanel Orientation="Horizontal">
+                    <ComboBox IsReadOnly="True" Name="FontTitleBox" Background="Transparent" Padding="10 10 0 0"  Width="148"   BorderThickness="1" BorderBrush="#FFE2E3E6"
+                                ItemsSource="{Binding FontStyleList}"
+                              ItemTemplate="{StaticResource FontStyleData}"
+                              >
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="SelectionChanged">
+                                <i:InvokeCommandAction Command="{Binding SelectedFontStyleCommand}" CommandParameter="{Binding ElementName=FontTitleBox,Path=SelectedItem}"/>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>
+                    </ComboBox>
+                    <Button Width="32" Height="32" ContextMenu="{StaticResource BtnFlyoutMenu}"/>
+                </StackPanel>
+            </Border>
+
+
+
+
+            <TextBlock x:Name="FontText"  FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
+
+            <Grid Margin="0,6,0,0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="auto"></RowDefinition>
+                    <RowDefinition Height="auto"></RowDefinition>
+                    <RowDefinition Height="auto"></RowDefinition>
+                </Grid.RowDefinitions>
+
+                <Border BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,0,4,0"  BorderThickness="0">
+                    <Grid>
+                        <ComboBox IsReadOnly="True" Name="FontFamilyBox" Background="Transparent" Padding="10 10 0 0"  BorderThickness="1" BorderBrush="#FFE2E3E6"
+                                >
+                            <ComboBox.ItemContainerStyle>
+                                <Style TargetType="{x:Type ComboBoxItem}">
+                                    <Setter Property="Padding" Value="10 0 0 0"/>
+                                </Style>
+                            </ComboBox.ItemContainerStyle>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
+                                <TextBlock Text="Courier New" FontFamily="Courier New" Tag="Courier"  FontSize="14"/>
+                            </ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
+                                <TextBlock Text="Arial" FontFamily="Arial" Tag="Helvetica" FontSize="14"/>
+                            </ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
+                                <TextBlock Text="Times New Roman" FontFamily="Times New Roman" Tag="Times Roman" FontSize="14"/>
+                            </ComboBoxItem>
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="SelectionChanged">
+                                    <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=SelectedIndex}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ComboBox>
+
+                        <TextBox Name="FontFamilyText" FontFamily="Segoe UI" FontSize="14" Background="White"  Padding="10 0 0 0" Margin="2,0,25,0" IsReadOnly="True"
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
+                        </TextBox>
+                    </Grid>
+                </Border>
+
+                <cus:ColorDropBox x:Name="FontColorBox" Grid.Column="1" Grid.Row="1" SelectedColorChanged="FontColorBox_SelectedColorChanged" BorderThickness="1" BorderBrush="#E2E3E6" Width="80" Height="32" HorizontalAlignment="Left"
+                                   ></cus:ColorDropBox>
+
+                <Border Grid.Row="1" BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,8,4,0"  BorderThickness="0">
+                    <Grid>
+                        <ComboBox Name="FontStyleBox" IsReadOnly="True" BorderThickness="1" BorderBrush="#FFE2E3E6" Padding="10 10 0 0" Background="Transparent">
+                            <ComboBox.ItemContainerStyle>
+                                <Style TargetType="{x:Type ComboBoxItem}">
+                                    <Setter Property="Padding" Value="10 0 0 0"/>
+                                </Style>
+                            </ComboBox.ItemContainerStyle>
+                            <ComboBoxItem x:Name="RegularItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Regular</ComboBoxItem>
+                            <ComboBoxItem x:Name="BoldItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold</ComboBoxItem>
+                            <ComboBoxItem x:Name="ItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Italic</ComboBoxItem>
+                            <ComboBoxItem x:Name="BoldItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold Italic</ComboBoxItem>
+
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="SelectionChanged">
+                                    <i:InvokeCommandAction Command="{Binding FontStyleChangedCommand}" CommandParameter="{Binding ElementName=FontStyleBox,Path=SelectedItem}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ComboBox>
+                        <TextBox Name="FontStyleText" IsReadOnly="True" FontFamily="Segoe UI" FontSize="14" Background="White" Padding="10 0 0 0" Height="20" Margin="2,0,35,0" 
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
+                        </TextBox>
+                    </Grid>
+                </Border>
+
+                <Border Grid.Row="0" Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="-1,8,0,0"  BorderThickness="0">
+                    <Grid>
+                        <ComboBox Name="FontSizeBox" BorderThickness="1" Background="Transparent" BorderBrush="#FFE2E3E6"
+                                  MaxDropDownHeight="200">
+                            <ComboBox.ItemContainerStyle>
+                                <Style TargetType="{x:Type ComboBoxItem}">
+                                    <Setter Property="Padding" Value="10 0 0 0"/>
+                                </Style>
+                            </ComboBox.ItemContainerStyle>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">6</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">8</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">9</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">10</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">12</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">14</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">18</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">20</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">22</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">24</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">26</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">28</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">32</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">36</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">48</ComboBoxItem>
+                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">72</ComboBoxItem>
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="SelectionChanged">
+                                    <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" CommandParameter="{Binding ElementName=FontSizeBox,Path=SelectedItem}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ComboBox>
+                        <TextBox Name="FontSizeText" FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Padding="10 0 0 0" Margin="2,0,35,0" 
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" IsReadOnly="True">
+                        </TextBox>
+                    </Grid>
+                </Border>
+
+
+                <Border Grid.ColumnSpan="2" Grid.Row="2" Width="148" Height="32" Margin="12,8,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6" HorizontalAlignment="Left">
+                    <Grid Name="ToolGrid">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*"></ColumnDefinition>
+                            <ColumnDefinition Width="*"></ColumnDefinition>
+                            <ColumnDefinition Width="*"></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+
+                        <ToggleButton Name="TextAlignLeftBtn" Tag="AlignLeft" Background="Transparent" BorderThickness="0" Click="BtnTextAlign_Click">
+                            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#000000" Data="M10,11 L10,12 L0,12 L0,11 L10,11 Z M16,7 L16,8 L0,8 L0,7 L16,7 Z M13,3 L13,4 L0,4 L0,3 L13,3 Z">
+                            </Path>
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="Checked">
+                                    <i:InvokeCommandAction Command="{Binding TextAlignChecked}" CommandParameter="{Binding ElementName=TextAlignLeftBtn,Path=Tag}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ToggleButton>
+                        <Line HorizontalAlignment="Left" Style="{StaticResource line1Style}" VerticalAlignment="Center" Grid.Column="1" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
+
+                        <ToggleButton Name="TextAlignCenterBtn" Tag="AlignCenter" Grid.Column="1" Background="Transparent"  BorderThickness="0"  Click="BtnTextAlign_Click">
+                            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#000000" Data="M16,11 L16,12 L0,12 L0,11 L16,11 Z M13,7 L13,8 L3,8 L3,7 L13,7 Z M16,3 L16,4 L0,4 L0,3 L16,3 Z">
+                            </Path>
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="Checked">
+                                    <i:InvokeCommandAction Command="{Binding TextAlignChecked}" CommandParameter="{Binding ElementName=TextAlignCenterBtn,Path=Tag}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ToggleButton>
+                        <Line HorizontalAlignment="Left" Style="{StaticResource line2Style}" VerticalAlignment="Center" Grid.Column="2" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
+
+                        <ToggleButton Name="TextAlignRightBtn" Tag="AlignRight" Grid.Column="2" Background="Transparent"  BorderThickness="0"  Click="BtnTextAlign_Click">
+                            <Path HorizontalAlignment="Center" VerticalAlignment="Center"  Fill="#000000" Data="M16,11 L16,12 L6.00061035,12 L6.00061035,11 L16,11 Z M16,7 L16,8 L0.0009765625,8 L0.0009765625,7 L16,7 Z M16,3 L16,4 L3.00079346,4 L3.00079346,3 L16,3 Z">
+                            </Path>
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="Checked">
+                                    <i:InvokeCommandAction Command="{Binding TextAlignChecked}" CommandParameter="{Binding ElementName=TextAlignRightBtn,Path=Tag}"/>
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </ToggleButton>
+                    </Grid>
+                </Border>
+            </Grid>
+
+
+            <Grid Margin="0,18,0,0">
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="auto"/>
+                    <RowDefinition/>
+                </Grid.RowDefinitions>
+                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"/>
+                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
+            </Grid>
+
+
+
+
+            <TextBlock x:Name="thicknessText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
+
+
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="*"></ColumnDefinition>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+
+                <Slider Name="ThicknessSlider" VerticalAlignment="Center" Margin="12,0,0,0" Width="148"  Minimum="0" Maximum="24" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True" 
+                    Style="{StaticResource RoundThumbSlider}"  TickFrequency="1" IsSnapToTickEnabled="True" >
+                    <Slider.Resources>
+                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
+                        <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
+                    </Slider.Resources>
+                </Slider>
+
+
+                <Border Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="0,0,11,0"  BorderThickness="0">
+                    <Grid>
+                        <ComboBox Name="ThicknessBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6"
+                                  MaxDropDownHeight="200">
+                            <ComboBox.ItemContainerStyle>
+                                <Style TargetType="{x:Type ComboBoxItem}">
+                                    <Setter Property="Padding" Value="10 0 0 0"/>
+                                </Style>
+                            </ComboBox.ItemContainerStyle>
+                            <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="18" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="21" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem Content="24" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                        </ComboBox>
+                        <TextBox Name="ThicknessText" Background="White" FontFamily="Segoe UI" FontSize="14"  Height="20" Margin="10,0,35,0" IsReadOnly="True"
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
+                        </TextBox>
+                    </Grid>
+                </Border>
+            </Grid>
+
+
+            <!--<StackPanel x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
+                <cus:CustomIconToggleBtn x:Name="BtnSolidLine" Tag="Solid" Width="110" Height="32" Click="BtnLineStyle_Click"
+                                              Style="{StaticResource ToggleBtnViewModeStyle}">
+                    <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30">
+                        <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" />
+                    </Border>
+                </cus:CustomIconToggleBtn>
+                <cus:CustomIconToggleBtn x:Name="BtnDottedLine" Tag="Dotted" Width="110" Height="32" Click="BtnLineStyle_Click"
+                                              Style="{StaticResource ToggleBtnViewModeStyle}">
+                    <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30" >
+                        <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                    </Border>
+                </cus:CustomIconToggleBtn>
+            </StackPanel>-->
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 11 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/TextEditProperty.xaml.cs

@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 
-namespace PDF_Office.Views.PropertyPanel.AnnotPanel
+namespace PDF_Office.Views.PropertyPanel
 {
     /// <summary>
     /// TextEditProperty.xaml 的交互逻辑
@@ -24,5 +24,15 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         {
             InitializeComponent();
         }
+
+        private void FontColorBox_SelectedColorChanged(object sender, Color? e)
+        {
+
+        }
+
+        private void BtnTextAlign_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 27 - 0
PDF Office/Views/Tools/TextEditToolContent.xaml

@@ -0,0 +1,27 @@
+<UserControl x:Class="PDF_Office.Views.Tools.TextEditToolContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.Views.Tools"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:customControl ="clr-namespace:PDF_Office.CustomControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <StackPanel Orientation="Horizontal">
+            <customControl:CustomIconToggleBtn x:Name="BtnAddText" Tag="SnapshotEdit" Style="{StaticResource ToggleBtnViewModeStyle}"  Foreground="Black" ContentStringFormat="156"
+                                               Command="{Binding AddContentCommand}" CommandParameter="{Binding ElementName=BtnAddText,Path=Tag}"  
+                                               >
+                <TextBlock Text="添加文本"/>
+            </customControl:CustomIconToggleBtn>
+            <customControl:CustomIconToggleBtn x:Name="BtnAddImage" Tag="SnapshotEdit" Style="{StaticResource ToggleBtnViewModeStyle}"  Foreground="Black" ContentStringFormat="156"
+                                             Command="{Binding AddContentCommand}" CommandParameter="{Binding ElementName=BtnAddImage,Path=Tag}"  
+                                               >
+                <TextBlock Text="添加图像"/>
+            </customControl:CustomIconToggleBtn>
+        </StackPanel>
+
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/Tools/TextEditToolContent.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Tools
+{
+    /// <summary>
+    /// TextEditToolContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class TextEditToolContent : UserControl
+    {
+        public TextEditToolContent()
+        {
+            InitializeComponent();
+        }
+    }
+}