Bladeren bron

注释 - 添加高亮注释

chenrongqian 2 jaren geleden
bovenliggende
commit
9c5f28fb29

+ 2 - 0
PDF Office/Model/ParameterNames.cs

@@ -25,6 +25,8 @@ namespace PDF_Office.Model
 
         public static string ViewContentViewModel = "ViewContentViewModel";
 
+        public static string PropertyPanelContentViewModel = "PropertyPanelContentViewModel";
+
 
         public static string InsertType_File = "Insert_File";
 

+ 1 - 0
PDF Office/PDF Office.csproj

@@ -213,6 +213,7 @@
       <DependentUpon>WritableComboBox.xaml</DependentUpon>
     </Compile>
     <Compile Include="DataConvert\FileFormatToIconConvert.cs" />
+    <Compile Include="DataConvert\PropertyPanelVisible.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
     <Compile Include="EventAggregators\PageEditNotifyEvent.cs" />
     <Compile Include="EventAggregators\PageEditRefreshEvent.cs" />

+ 36 - 2
PDF Office/ViewModels/PropertyPanel/PropertyPanelContentViewModel.cs

@@ -1,4 +1,7 @@
-using System;
+using PDF_Office.DataConvert;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -6,7 +9,38 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.ViewModels.PropertyPanel
 {
-    internal class PropertyPanelContentViewModel
+    public enum PanelType
     {
+        AnnotType,
+        WaterMarkType,
+    }
+    public class PropertyPanelContentViewModel : BindableBase
+    {
+        private string _annotPanelType = "HighLight";
+        public string AnnotPanelType
+        {
+            get { return _annotPanelType; }
+            set {
+                SetProperty(ref _annotPanelType, value);
+             
+            }
+        }
+
+        private PanelType _propertyPanelType;
+        public PanelType PropertyPanelType
+        {
+            get { return _propertyPanelType; }
+            set
+            {
+                SetProperty(ref _propertyPanelType, value);
+
+            }
+        }
+
+
+        public PropertyPanelContentViewModel()
+        {
+
+        }
     }
 }

+ 29 - 12
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -4,6 +4,9 @@ using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Properties;
+using PDF_Office.ViewModels.PropertyPanel;
+using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -23,6 +26,7 @@ namespace PDF_Office.ViewModels.Tools
     {
         private CPDFViewer PDFViewer;
         private ViewContentViewModel viewContentViewModel;
+        private PropertyPanelContentViewModel propertyPanelContentViewModel;
         public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
 
         public AnnotToolContentViewModel()
@@ -36,14 +40,14 @@ namespace PDF_Office.ViewModels.Tools
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             UserControl propertyPanel = null;
-
+            AnnotHandlerEventArgs annotArgs = null;
             switch (annotBtn.Tag.ToString())
             {
                 case "SnapshotEdit":
                     break;
 
                 case "HighLight":
-                    TextHighlightAnnotArgs highlightArgs = new TextHighlightAnnotArgs();
+                    TextHighlightAnnotArgs highlightArgs = new TextHighlightAnnotArgs(); 
                     highlightArgs.Color = Color.FromRgb(0xFF, 0xBB, 0x00);
                     highlightArgs.Transparency = 0.5;
                     DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotHighlight);
@@ -56,17 +60,17 @@ namespace PDF_Office.ViewModels.Tools
                     annotAttribsList[AnnotAttrib.Color] = highlightArgs.Color;
                     annotAttribsList[AnnotAttrib.Transparency] = highlightArgs.Transparency;
                     annotAttribsList[AnnotAttrib.NoteText] = string.Empty;
-                   
-                 /*   TextAnnotProperty textAnnotProperty = new TextAnnotProperty();
-                    textAnnotProperty.DataChanged += AnnotPropertyPanel_DataChanged;
-                    textAnnotProperty.DefaultStored += AnnotProperty_DefaultStored;
-                    textAnnotProperty.SetAnnotType(highlightArgs.EventType);
-                    textAnnotProperty.SetSelectedColor(highlightArgs.Color);
-                    textAnnotProperty.SetSelectOpacity(highlightArgs.Transparency);
-                    textAnnotProperty.SetNoteContent(highlightArgs.Content);
-                    textAnnotProperty.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(highlightArgs, annotAttribsList);
+
+                    TextAnnotProperty textAnnotProperty = new TextAnnotProperty();
+                    //textAnnotProperty.DataChanged += AnnotPropertyPanel_DataChanged;
+                    //textAnnotProperty.DefaultStored += AnnotProperty_DefaultStored;
+                    //textAnnotProperty.SetAnnotType(highlightArgs.EventType);
+                    //textAnnotProperty.SetSelectedColor(highlightArgs.Color);
+                    //textAnnotProperty.SetSelectOpacity(highlightArgs.Transparency);
+                    //textAnnotProperty.SetNoteContent(highlightArgs.Content);
+                    //textAnnotProperty.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(highlightArgs, annotAttribsList);
                     propertyPanel = textAnnotProperty;
-                    annotArgs = highlightArgs;*/
+                    annotArgs = highlightArgs;
 
                     if (!ToolExpandDict.ContainsKey("HighLight"))
                     {
@@ -120,6 +124,17 @@ namespace PDF_Office.ViewModels.Tools
 
             }
 
+
+            if (annotArgs != null)
+            {
+                annotArgs.Author = Settings.Default.AppProperties.Description.Author;
+                PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                PDFViewer.SetToolParam(annotArgs);
+                if (propertyPanel != null)
+                {
+                 //   viewCtrl.AddAnnotPropertyPanel(propertyPanel);
+                }
+            }
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -136,6 +151,8 @@ namespace PDF_Office.ViewModels.Tools
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
 
+            navigationContext.Parameters.TryGetValue<PropertyPanelContentViewModel>(ParameterNames.PropertyPanelContentViewModel, out propertyPanelContentViewModel);
+
             if (PDFViewer != null)
             {
 

+ 3 - 215
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

@@ -7,219 +7,7 @@
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
-    <UserControl.Resources>
-        <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
-            </ResourceDictionary.MergedDictionaries>
-            <Style TargetType="ComboBoxItem">
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate>
-                            <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
-                        Padding="{TemplateBinding Control.Padding}"
-                        BorderBrush="{TemplateBinding Border.BorderBrush}"
-                        Background="{TemplateBinding Panel.Background}"
-                        Name="Bd"
-                        SnapsToDevicePixels="True">
-                                <ContentPresenter Content="{TemplateBinding ContentControl.Content}"
-                                      ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
-                                      ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
-                                      HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
-                                      VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
-                                      SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
-                            </Border>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="UIElement.IsEnabled"
-                             Value="False">
-                                    <Setter Property="TextElement.Foreground"
-                                TargetName="Bd"
-                                Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
-                                </Trigger>
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="Selector.IsSelected"
-                                       Value="False" />
-                                        <Condition Property="UIElement.IsMouseOver"
-                                       Value="True" />
-                                        <Condition Property="UIElement.IsKeyboardFocused"
-                                       Value="False" />
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.Background"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                    <Setter Property="Border.BorderBrush"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                </MultiTrigger>
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="Selector.IsSelected"
-                                       Value="True" />
-                                        <Condition Property="UIElement.IsMouseOver"
-                                       Value="False" />
-                                        <Condition Property="UIElement.IsKeyboardFocused"
-                                       Value="True" />
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.Background"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                    <Setter Property="Border.BorderBrush"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                </MultiTrigger>
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="Selector.IsSelected"
-                                       Value="True" />
-                                        <Condition Property="UIElement.IsMouseOver"
-                                       Value="True" />
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.Background"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                    <Setter Property="Border.BorderBrush"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                </MultiTrigger>
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="Selector.IsSelected"
-                                       Value="True" />
-                                        <Condition Property="UIElement.IsMouseOver"
-                                       Value="False" />
-                                        <Condition Property="UIElement.IsKeyboardFocused"
-                                       Value="False" />
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.Background"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                    <Setter Property="Border.BorderBrush"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                </MultiTrigger>
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="Selector.IsSelected"
-                                       Value="False" />
-                                        <Condition Property="UIElement.IsMouseOver"
-                                       Value="False" />
-                                        <Condition Property="UIElement.IsKeyboardFocused"
-                                       Value="True" />
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Border.BorderBrush"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                </MultiTrigger>
-                                <MultiTrigger>
-                                    <MultiTrigger.Conditions>
-                                        <Condition Property="Selector.IsSelected"
-                                       Value="False" />
-                                        <Condition Property="UIElement.IsMouseOver"
-                                       Value="True" />
-                                        <Condition Property="UIElement.IsKeyboardFocused"
-                                       Value="True" />
-                                    </MultiTrigger.Conditions>
-                                    <Setter Property="Panel.Background"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                    <Setter Property="Border.BorderBrush"
-                                TargetName="Bd"
-                                Value="#CCCCCC" />
-                                </MultiTrigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-            </Style>
-
-        </ResourceDictionary>
-    </UserControl.Resources>
-    <StackPanel Margin="12 0 12 0">
-        <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Center" Margin="0,8,0,0"></TextBlock>
-        <Border Width="232" Height="80" BorderThickness="1" BorderBrush="#E2E3E6" Margin="0,8,0,0">
-            <Grid>
-                <TextBlock Name="SampleText" Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Segoe UI" FontSize="18">
-                </TextBlock>
-                <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>
-
-                <Path Name="StickyPath" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" Fill="#FF8133"
-                      Data="M28.8,4.8 L28.8,24 L16,24 L8,28.8 L8,24 L3.2,24 L3.2,4.8 L28.8,4.8 Z M24,15.2 L8,15.2 L8,17.6 L24,17.6 L24,15.2 Z M17.6,9.6 L8,9.6 L8,12 L17.6,12 L17.6,9.6 Z">
-
-                </Path>
-            </Grid>
-        </Border>
-        <Grid Margin="0,18,0,0">
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="*"></ColumnDefinition>
-                <ColumnDefinition Width="*"></ColumnDefinition>
-            </Grid.ColumnDefinitions>
-            <TextBlock x:Name="colorText"  LineHeight="20" TextAlignment="Left" VerticalAlignment="Center">Color</TextBlock>
-            <cus:ColorDropBox x:Name="ColorDropPicker" Grid.Column="1" BorderThickness="1"  HorizontalAlignment="Right"
-                                BorderBrush="#E2E3E6" Width="80" Height="32" SelectedColorChanged="ColorDropPicker_SelectedColorChanged" ></cus:ColorDropBox>
-        </Grid>
-        <TextBlock x:Name="opacityText"  TextAlignment="Left" LineHeight="20" Margin="0,14,0,0" >Opacity</TextBlock>
-        <Grid>
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="*"></ColumnDefinition>
-                <ColumnDefinition Width="auto"></ColumnDefinition>
-            </Grid.ColumnDefinitions>
-            <Slider Name="OpacitySlider" HorizontalAlignment="Left" VerticalAlignment="Center" Minimum="0" Maximum="1" IsSelectionRangeEnabled="True" IsSnapToTickEnabled="True" IsMoveToPointEnabled="True"
-                    Style="{StaticResource RoundThumbSlider}" Width="148" TickFrequency="0.01" ValueChanged="OpacitySlider_ValueChanged" Thumb.DragStarted="OpacitySlider_DragStarted" 
-                    Thumb.DragCompleted="OpacitySlider_DragCompleted">
-                <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" HorizontalAlignment="Right" Background="Transparent" BorderBrush="#E2E3E6"  Width="80" Height="32"  BorderThickness="0">
-                <Grid>
-                    <ComboBox Name="OpacityDropBox" BorderThickness="1" Background="Transparent" BorderBrush="#FFE2E3E6">
-                        <ComboBoxItem Content="25%" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="50%" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}" />
-                        <ComboBoxItem Content="75%" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}" />
-                        <ComboBoxItem Content="100%" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}" />
-                    </ComboBox>
-                    <TextBox FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Margin="2,0,23,0" IsReadOnly="True"
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Center">
-                        <TextBox.Style>
-                            <Style TargetType="TextBox">
-                                <Style.Setters>
-                                    <Setter Property="TextBox.Text">
-                                        <Setter.Value>
-                                            <MultiBinding StringFormat="P0">
-                                                <Binding ElementName="OpacitySlider" Path="Value"></Binding>
-                                            </MultiBinding>
-                                        </Setter.Value>
-                                    </Setter>
-                                </Style.Setters>
-                            </Style>
-                        </TextBox.Style>
-                    </TextBox>
-                </Grid>
-            </Border>
-        </Grid>
-        <StackPanel Margin="0 36 0 0">
-            <cus:ToastControl x:Name="tip" Width="auto" Height="20" FontFamily="Segoe UI" FontSize="12" Background="#1A477EDE" Foreground="#477EDE"/>
-
-            <Button x:Name="UseAsDefaultBtn"  Margin="0 8 0 0" Content="Use As Default"  Width="232" Height="32" Foreground="#273C62" FontWeight="SemiBold"
-                Background="White" BorderThickness="1" BorderBrush="#273C62" FontFamily="Segoe UI" FontSize="14" ></Button>
-        </StackPanel>
-        <TextBlock x:Name="NoteText" Text="Note" TextAlignment="Left" LineHeight="20" Margin="0,30,0,0"></TextBlock>
-        <TextBox Name="AnnotNoteText" FontSize="14" TextWrapping="Wrap" BorderBrush="#E2E3E6" Width="232" Height="96" Margin="0,10,0,0"  AcceptsReturn="True">
-        </TextBox>
-    </StackPanel>
+    <Grid  Width="250" VerticalAlignment="Stretch" Background="Wheat">
+        
+    </Grid>
 </UserControl>

+ 403 - 14
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml.cs

@@ -1,4 +1,8 @@
-using System;
+using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.Properties;
+using PDFSettings;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -24,25 +28,410 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         {
             InitializeComponent();
         }
+    }
+    //public partial class TextAnnotProperty : UserControl
+    //{
+    //    /// <summary>
+    //    /// 属性更改事件
+    //    /// </summary>
+    //    public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
+    //    /// <summary>
+    //    /// 默认值设置事件
+    //    /// </summary>
+    //    public event EventHandler<object> DefaultStored;
+    //    public Color? SelectedColor { get { return ColorDropPicker.SelectedColor; } }
+    //    public string AnnotTitle { get { return AnnotTypeTitle.Text; } }
+    //    public string AnnoteNote { get { return AnnotNoteText.Text; } }
+    //    public double AnnotOpacity { get { return OpacitySlider.Value; } }
+    //    public AnnotArgsType AnnotType { get; private set; }
+    //    public AnnotAttribEvent AnnotEvent { get; set; }
 
-        private void OpacitySlider_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
-        {
+    //    private bool DisableValueChange = false;
 
-        }
+    //    public TextAnnotProperty()
+    //    {
+    //        InitializeComponent();
+    //        SetLangText();
 
-        private void OpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
-        {
+    //        string font = Settings.Default.AppProperties.Annotate.AnchoredFamaily;
+    //        if (font.Equals("Courier"))
+    //            AnnotNoteText.FontFamily = new FontFamily("Courier New");
+    //        else if (font.Equals("Helvetica"))
+    //            AnnotNoteText.FontFamily = new FontFamily("Arial");
+    //        else
+    //            AnnotNoteText.FontFamily = new FontFamily("Times New Roman");
+    //        DataContext = this;
+    //        PathFigure FigureData = GetSquigglyPathFigure(new Point(0, 0), new Point(62, 0), 60, 2);
+    //        PathGeometry SquigglyGeometry = new PathGeometry();
+    //        PathFigureCollection FiguresCollection = new PathFigureCollection();
+    //        SquigglyGeometry.Figures = FiguresCollection;
+    //        FiguresCollection.Add(FigureData);
+    //        SquigglyPath.Data = SquigglyGeometry;
+    //    }
 
-        }
 
-        private void OpacitySlider_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
-        {
+    //    private void SetLangText()
+    //    {
+    //        //SampleText.Text = App.MainPageLoader.GetString("ProperPanel_Example");
+    //        //colorText.Text = App.MainPageLoader.GetString("ProperPanel_Color");
+    //        //opacityText.Text = App.MainPageLoader.GetString("ProperPanel_Opacity");
+    //        //UseAsDefaultBtn.Content = App.MainPageLoader.GetString("ProperPanel_SetAsDefault");
+    //        //NoteText.Text = App.MainPageLoader.GetString("ProperPanel_Note");
+    //    }
+    //    private void SetTextDecoratePath(Color? selectColor, double? opacity)
+    //    {
+    //        UnderlinePath.Visibility = Visibility.Collapsed;
+    //        StrikeoutPath.Visibility = Visibility.Collapsed;
+    //        SquigglyPath.Visibility = Visibility.Collapsed;
+    //        UnderlinePath.Opacity = 1;
+    //        StrikeoutPath.Opacity = 1;
+    //        UnderlinePath.Opacity = 1;
 
-        }
+    //        switch (AnnotType)
+    //        {
+    //            case AnnotArgsType.AnnotHighlight:
+    //                if (selectColor != null)
+    //                {
+    //                    SampleText.Background = new SolidColorBrush((Color)selectColor);
+    //                }
+    //                if (opacity != null)
+    //                {
+    //                    SampleText.Background.Opacity = (double)opacity;
+    //                }
+    //                break;
+    //            case AnnotArgsType.AnnotUnderline:
+    //                UnderlinePath.Visibility = Visibility.Visible;
+    //                SampleText.Background = Brushes.Transparent;
+    //                if (opacity != null)
+    //                {
+    //                    UnderlinePath.Opacity = (double)opacity;
+    //                }
+    //                if (selectColor != null)
+    //                {
+    //                    UnderlinePath.Stroke = new SolidColorBrush((Color)selectColor);
+    //                }
+    //                break;
+    //            case AnnotArgsType.AnnotStrikeout:
+    //                StrikeoutPath.Visibility = Visibility.Visible;
+    //                SampleText.Background = Brushes.Transparent;
+    //                if (opacity != null)
+    //                {
+    //                    StrikeoutPath.Opacity = (double)opacity;
+    //                }
+    //                if (selectColor != null)
+    //                {
+    //                    StrikeoutPath.Stroke = new SolidColorBrush((Color)selectColor);
+    //                }
+    //                break;
+    //            case AnnotArgsType.AnnotSquiggly:
+    //                SquigglyPath.Visibility = Visibility.Visible;
+    //                SampleText.Background = Brushes.Transparent;
+    //                if (opacity != null)
+    //                {
+    //                    SquigglyPath.Opacity = (double)opacity;
+    //                }
+    //                if (selectColor != null)
+    //                {
+    //                    SquigglyPath.Stroke = new SolidColorBrush((Color)selectColor);
+    //                }
+    //                break;
+    //            case AnnotArgsType.AnnotSticky:
+    //                {
+    //                    if (opacity != null)
+    //                    {
+    //                        StickyPath.Opacity = (double)opacity;
+    //                    }
+    //                    if (selectColor != null)
+    //                    {
+    //                        StickyPath.Fill = new SolidColorBrush((Color)selectColor);
+    //                    }
+    //                }
+    //                break;
+    //            default:
+    //                break;
+    //        }
+    //    }
 
-        private void ColorDropPicker_SelectedColorChanged(object sender, Color? e)
-        {
+    //    public void SetSelectedColor(Color selectColor)
+    //    {
+    //        bool changed = false;
+    //        if (ColorDropPicker.SelectedColor != selectColor)
+    //        {
+    //            changed = true;
+    //        }
+    //        ColorDropPicker.SetSelectedColor(selectColor);
+    //        SetTextDecoratePath(selectColor, null);
+    //        if (changed)
+    //        {
+    //            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+    //            changeData[AnnotType] = selectColor;
+    //            DataChanged?.Invoke(this, changeData);
+    //        }
+    //    }
 
-        }
-    }
+    //    public void SetSelectOpacity(double opacity)
+    //    {
+    //        OpacitySlider.Value = opacity;
+    //        SetTextDecoratePath(null, opacity);
+    //    }
+    //    public void SetNoteContent(string textNote)
+    //    {
+    //        AnnotNoteText.Text = textNote;
+    //    }
+
+    //    public void SetAnnotType(AnnotArgsType annotType)
+    //    {
+    //        //AnnotType = annotType;
+    //        //switch (annotType)
+    //        //{
+    //        //    case AnnotArgsType.AnnotHighlight:
+    //        //        AnnotTypeTitle.Text = App.MainPageLoader.GetString("SubTools_Tools_Highlight");
+    //        //        break;
+    //        //    case AnnotArgsType.AnnotUnderline:
+    //        //        AnnotTypeTitle.Text = App.MainPageLoader.GetString("SubTools_Tools_Underline");
+    //        //        break;
+    //        //    case AnnotArgsType.AnnotStrikeout:
+    //        //        AnnotTypeTitle.Text = App.MainPageLoader.GetString("SubTools_Tools_Strikthrough");
+    //        //        break;
+    //        //    case AnnotArgsType.AnnotSquiggly:
+    //        //        AnnotTypeTitle.Text = App.MainPageLoader.GetString("SubTools_Tools_Squiggly");
+    //        //        break;
+    //        //    case AnnotArgsType.AnnotSticky:
+    //        //        AnnotTypeTitle.Text = App.MainPageLoader.GetString("SubTools_Tools_AnchoredNote");
+    //        //        SampleText.Visibility = Visibility.Collapsed;
+    //        //        StickyPath.Visibility = Visibility.Visible;
+    //        //        break;
+    //        //    default:
+    //        //        break;
+    //        //}
+    //    }
+
+    //    private void ColorDropPicker_SelectedColorChanged(object sender, Color? e)
+    //    {
+    //        if (e != null && AnnotEvent != null)
+    //        {
+    //            AnnotEvent.UpdateAttrib(AnnotAttrib.Color, e);
+    //            AnnotEvent.UpdateAnnot();
+    //            double? opacity = null;
+    //            if (OpacitySlider != null)
+    //            {
+    //                opacity = OpacitySlider.Value;
+    //            }
+    //            SetTextDecoratePath(e, opacity);
+    //            if (e != null)
+    //            {
+    //                Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+    //                changeData[AnnotType] = e;
+    //                DataChanged?.Invoke(this, changeData);
+    //            }
+    //        }
+    //    }
+
+    //    private void OpacitySlider_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
+    //    {
+    //        DisableValueChange = false;
+    //        if (AnnotEvent != null)
+    //        {
+    //            AnnotEvent.UpdateAttrib(AnnotAttrib.Transparency, OpacitySlider.Value);
+    //            AnnotEvent.UpdateAnnot();
+    //            SetTextDecoratePath(null, OpacitySlider.Value);
+    //            if (e != null)
+    //            {
+    //                Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+    //                changeData[AnnotType] = OpacitySlider.Value;
+    //                DataChanged?.Invoke(this, changeData);
+    //            }
+    //        }
+    //    }
+
+    //    private void OpacitySlider_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
+    //    {
+    //        DisableValueChange = true;
+    //    }
+
+    //    private void OpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+    //    {
+    //        if (AnnotEvent != null && DisableValueChange == false)
+    //        {
+    //            AnnotEvent.UpdateAttrib(AnnotAttrib.Transparency, e.NewValue);
+    //            AnnotEvent.UpdateAnnot();
+    //            SetTextDecoratePath(null, e.NewValue);
+    //            if (e != null)
+    //            {
+    //                Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+    //                changeData[AnnotType] = e.NewValue;
+    //                DataChanged?.Invoke(this, changeData);
+    //            }
+    //        }
+    //    }
+
+    //    private PathFigure GetSquigglyPathFigure(Point StartPoint, Point EndPoint, double PathWidth, double PathHeight)
+    //    {
+    //        PathFigure FigureData = new PathFigure();
+    //        FigureData.StartPoint = StartPoint;
+
+    //        int Radius = (int)Math.Max(2, 2);
+    //        if (PathWidth > PathHeight)
+    //        {
+    //            // 橫線
+    //            var arcCount = PathWidth / (Radius * 2);
+    //            var x = StartPoint.X;
+    //            if (EndPoint.X > StartPoint.X)
+    //            {
+    //                // left to right 
+    //                for (int i = 0; i < arcCount; i++)
+    //                {
+    //                    if (i % 2 == 0)
+    //                    {
+    //                        // 上弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(x, StartPoint.Y),
+    //                            Point2 = new Point(x + Radius, StartPoint.Y - Radius),
+    //                            Point3 = new Point(x + Radius * 2, StartPoint.Y)
+    //                        });
+    //                    }
+    //                    else
+    //                    {
+    //                        // 下弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(x, StartPoint.Y),
+    //                            Point2 = new Point(x + Radius, StartPoint.Y + Radius),
+    //                            Point3 = new Point(x + Radius * 2, StartPoint.Y)
+    //                        });
+    //                    }
+    //                    x += Radius * 2;
+    //                }
+    //            }
+    //            else
+    //            {
+    //                // right to left 
+    //                for (int i = 0; i < arcCount; i++)
+    //                {
+    //                    if (i % 2 == 0)
+    //                    {
+    //                        //下弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(x, StartPoint.Y),
+    //                            Point2 = new Point(x - Radius, StartPoint.Y + Radius),
+    //                            Point3 = new Point(x - Radius * 2, StartPoint.Y)
+    //                        });
+    //                    }
+    //                    else
+    //                    {
+    //                        //上弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(x, StartPoint.Y),
+    //                            Point2 = new Point(x - Radius, StartPoint.Y - Radius),
+    //                            Point3 = new Point(x - Radius * 2, StartPoint.Y)
+    //                        });
+    //                    }
+    //                    x -= Radius * 2;
+    //                }
+    //            }
+    //        }
+    //        else
+    //        {
+    //            // 直線
+    //            var arcCount = PathHeight / (Radius * 2);
+    //            var y = StartPoint.Y;
+    //            if (EndPoint.Y > StartPoint.Y)
+    //            {
+    //                // up to down 
+    //                for (int i = 0; i < arcCount; i++)
+    //                {
+    //                    if (i % 2 == 0)
+    //                    {
+    //                        //右弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(StartPoint.X, y),
+    //                            Point2 = new Point(StartPoint.X + Radius, y + Radius),
+    //                            Point3 = new Point(StartPoint.X, y + Radius * 2)
+    //                        });
+    //                    }
+    //                    else
+    //                    {
+    //                        //左弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(StartPoint.X, y),
+    //                            Point2 = new Point(StartPoint.X - Radius, y + Radius),
+    //                            Point3 = new Point(StartPoint.X, y + Radius * 2)
+    //                        });
+    //                    }
+    //                    y += Radius * 2;
+    //                }
+    //            }
+    //            else
+    //            {
+    //                // down to up
+    //                for (int i = 0; i < arcCount; i++)
+    //                {
+    //                    if (i % 2 == 0)
+    //                    {
+    //                        //左弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(StartPoint.X, y),
+    //                            Point2 = new Point(StartPoint.X - Radius, y - Radius),
+    //                            Point3 = new Point(StartPoint.X, y - Radius * 2)
+    //                        });
+    //                    }
+    //                    else
+    //                    {
+    //                        //右弧
+    //                        FigureData.Segments.Add(new BezierSegment()
+    //                        {
+    //                            Point1 = new Point(StartPoint.X, y),
+    //                            Point2 = new Point(StartPoint.X + Radius, y - Radius),
+    //                            Point3 = new Point(StartPoint.X, y - Radius * 2)
+    //                        });
+    //                    }
+    //                    y -= Radius * 2;
+    //                }
+    //            }
+    //        }
+
+    //        return FigureData;
+    //    }
+
+    //    private void Button_StoreAsDefaultProperty(object sender, RoutedEventArgs e)
+    //    {
+    //        DefaultAnnotProperty defaultProperty = new DefaultAnnotProperty();
+    //        defaultProperty.AnnotToolType = AnnotType;
+    //        defaultProperty.ForgoundColor = ColorDropPicker.SelectedColor == null ? Colors.Yellow : (Color)ColorDropPicker.SelectedColor;
+    //        defaultProperty.Opacity = OpacitySlider.Value;
+    //        Helper.SettingHelper.SetAnnotDefaultProperty(defaultProperty);
+    //        DefaultStored?.Invoke(this, null);
+
+    //    }
+
+    //    private void AnnotNoteText_LostFocus(object sender, RoutedEventArgs e)
+    //    {
+    //        AnnotEvent?.UpdateAttrib(AnnotAttrib.NoteText, AnnotNoteText.Text);
+    //        AnnotEvent?.UpdateAnnot();
+    //    }
+
+    //    public void NoteFocus()
+    //    {
+    //        AnnotNoteText.Focus();
+    //    }
+
+    //    private void OpacityItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+    //    {
+    //        ComboBoxItem selectItem = sender as ComboBoxItem;
+    //        if (selectItem != null && selectItem.Content != null)
+    //        {
+    //            int opacity = -1;
+    //            if (int.TryParse(selectItem.Content.ToString().TrimEnd('%'), out opacity))
+    //            {
+    //                OpacitySlider.Value = opacity / 100D;
+    //            }
+    //        }
+    //    }
+    //}
 }

+ 21 - 1
PDF Office/Views/PropertyPanel/PropertyPanelContent.xaml

@@ -4,9 +4,29 @@
              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:AnnotPanel="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+              xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
+    <UserControl.Resources>
+        <Convert:PropertyPanelVisible x:Key="PropertyPanelVisible"/>
+    </UserControl.Resources>
+    <Grid >
+        <Grid x:Name="GridAnnot">
+            <AnnotPanel:TextAnnotProperty x:Name="textAnnotProperty"  Visibility="{Binding AnnotPanelType,ConverterParameter=HighLight, Converter={StaticResource PropertyPanelVisible}}"/>
+            <!--<AnnotPanel:FreetextAnnotProperty  x:Name="freetextAnnotProperty" Visibility="{Binding AnnotPanelType,ConverterParameter=Freetext,Converter={StaticResource PropertyPanelVisible}}"/>
+            <AnnotPanel:SharpsAnnotProperty  x:Name="sharpsAnnotProperty" Visibility="{Binding AnnotPanelType,ConverterParameter=HighLight,Converter={StaticResource PropertyPanelVisible}}"/>
+            <AnnotPanel:StampAnnotProperty  x:Name="stampAnnotProperty" Visibility="{Binding AnnotPanelType,ConverterParameter=HighLight,Converter={StaticResource PropertyPanelVisible}}"/>
+            <AnnotPanel:FreehandAnnotProperty  x:Name="freehandAnnotProperty" Visibility="{Binding AnnotPanelType,ConverterParameter=HighLight,Converter={StaticResource PropertyPanelVisible}}"/>
+            <AnnotPanel:ImageAnnotProperty  x:Name="imageAnnotProperty" Visibility="{Binding AnnotPanelType,ConverterParameter=HighLight,Converter={StaticResource PropertyPanelVisible}}"/>
+            <AnnotPanel:LinkAnnotProperty  x:Name="linkAnnotProperty" Visibility="{Binding AnnotPanelType,ConverterParameter=HighLight,Converter={StaticResource PropertyPanelVisible}}"/>-->
+
+        </Grid>
+        <Grid>
             
+        </Grid>
+     
     </Grid>
 </UserControl>

+ 6 - 1
PDF Office/Views/PropertyPanel/PropertyPanelContent.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using PDF_Office.DataConvert;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -20,9 +21,13 @@ namespace PDF_Office.Views.PropertyPanel
     /// </summary>
     public partial class PropertyPanelContent : UserControl
     {
+
+
         public PropertyPanelContent()
         {
             InitializeComponent();
+      
         }
+
     }
 }

+ 3 - 1
PDF Office/Views/ViewContent.xaml

@@ -151,7 +151,7 @@
             </i:Interaction.Triggers>
         </TabControl>
 
-        <PropertyPanel:PropertyPanelContent/>
+      
         <!--<ScrollViewer Name="PropScrollView" Grid.Row="2" SizeChanged="PropPanel_SizeChanged" VerticalScrollBarVisibility="Auto" Focusable="False">
             <Grid x:Name="PropPanel">
             </Grid>
@@ -187,6 +187,8 @@
             <Button Grid.Column="3" />
             <ContentControl Grid.Column="4" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
         </Grid>
+
+        <PropertyPanel:PropertyPanelContent Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
         <local:BottomToolContent Grid.Row="3" />
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->