浏览代码

ComPDFKit(win) - 注释回复初步

weixiangjie 6 月之前
父节点
当前提交
dc38b51962

文件差异内容过多而无法显示
+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListControl/CPDFAnnotationListControl.xaml


+ 42 - 5
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListControl/CPDFAnnotationListControl.xaml.cs

@@ -1,4 +1,5 @@
-using ComPDFKit.PDFAnnotation;
+using System;
+using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFDocument;
 using ComPDFKit.PDFPage;
 using ComPDFKit.Tool;
@@ -6,13 +7,15 @@ using ComPDFKit.Tool.Help;
 using ComPDFKitViewer;
 using ComPDFKitViewer.BaseObject;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using System.IO;
 using System.Windows;
 using System.Windows.Annotations;
 using System.Windows.Controls;
 using Compdfkit_Tools.Helper;
-using static Compdfkit_Tools.PDFControlUI.CPDFAnnoationListUI;
+using Compdfkit_Tools.PDFControlUI;
+using static Compdfkit_Tools.PDFControlUI.CPDFAnnotationListUI;
 
 namespace Compdfkit_Tools.PDFControl
 {
@@ -43,6 +46,14 @@ namespace Compdfkit_Tools.PDFControl
         {
             AnnotationList.DeleteItemHandler -= AnnotationList_DeleteItemHandler;
             AnnotationList.DeleteItemHandler += AnnotationList_DeleteItemHandler;
+            AnnotationReplyListControl.ReplyListChanged -= ReplyListControl_ReplyListChanged;
+            AnnotationReplyListControl.ReplyListChanged += ReplyListControl_ReplyListChanged;
+        }
+
+        private void ReplyListControl_ReplyListChanged(object sender, EventArgs e)
+        {
+            LoadAnnotationList();
+            pdfViewer.PDFViewTool.IsDocumentModified = true;
         }
 
         private void AnnotationList_DeleteItemHandler(object sender, Dictionary<int, List<int>> e)
@@ -95,6 +106,7 @@ namespace Compdfkit_Tools.PDFControl
 
             List<BindAnnotationResult> bindAnnotationResults = new List<BindAnnotationResult>();
 
+            pdfViewer.UpdateAnnotFrame();
             for (int i = 0; i < pageCount; i++)
             {
 
@@ -105,11 +117,36 @@ namespace Compdfkit_Tools.PDFControl
                     {
                         foreach (AnnotParam annot in annotList)
                         {
-                            bindAnnotationResults.Add(new BindAnnotationResult
+                            CPDFAnnotation annotCore = pdfViewer?.GetCPDFViewer()?.GetAnnotForIndex(i, annot.AnnotIndex)?.GetAnnotData()?.Annot;
+                            if(annotCore == null || annotCore.IsReplyAnnot())
+                            {
+                                continue;
+                            }
+                            
+                            var bindResult = new BindAnnotationResult
                             {
                                 PageIndex = i,
-                                annotationData = annot
-                            });
+                                annotationData = annot,
+                                Annotation = annotCore
+                            };
+                            
+                            List<CPDFAnnotation> replyAnnotations = annotCore?.GetReplies();
+                            if(replyAnnotations != null && replyAnnotations.Count > 0)
+                            {
+                                foreach (CPDFAnnotation replyAnnot in replyAnnotations)
+                                {
+                                    if (replyAnnot == null)
+                                    {
+                                        continue;
+                                    }
+                                    
+                                    bindResult.ReplyList.Add(new ReplyData
+                                    {
+                                        ReplyAnnotation = replyAnnot,
+                                    });
+                                }
+                            }
+                            bindAnnotationResults.Add(bindResult);
                         }
                     });
                 }

+ 105 - 0
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/AnnotationReplyListControl.xaml

@@ -0,0 +1,105 @@
+<UserControl x:Class="Compdfkit_Tools.PDFControlUI.AnnotationReplyListControl"
+             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:common="clr-namespace:Compdfkit_Tools.Common"
+             xmlns:pdfControlUi="clr-namespace:Compdfkit_Tools.PDFControlUI"
+             mc:Ignorable="d"
+             d:DesignHeight="300" d:DesignWidth="300">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Asset/Styles/MenuItemStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+            <common:TextLengthToVisibilityConverter x:Key="TextLengthToVisibilityConverter"></common:TextLengthToVisibilityConverter>
+            <pdfControlUi:SubtractionConverter x:Key="SubtractionConverter"/>
+            <pdfControlUi:AntiVisibilityConverter x:Key="AntiVisibilityConverter"></pdfControlUi:AntiVisibilityConverter>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid x:Name="ReplyGrid" Margin="5">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"></RowDefinition>
+            <RowDefinition Height="Auto"></RowDefinition>
+            <RowDefinition Height="Auto"></RowDefinition>
+        </Grid.RowDefinitions>
+        
+        <Grid Grid.Row="0">
+            <TextBox x:Name="InputTxb" Height="30" VerticalContentAlignment="Center"></TextBox>
+            <TextBlock Text="Reply or add thoughts" VerticalAlignment="Center" Margin="10,0,0,0" Foreground="#A0A0A0" IsHitTestVisible="False"
+                       Visibility="{Binding ElementName=InputTxb, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}"></TextBlock>
+        </Grid>
+        
+        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,0">
+            <Button Content="Cancel" Background="Transparent" BorderThickness="0" Margin="0,0,5,0" Width="56" Height="30"></Button>
+            <Button Content="Reply" Width="56" Height="30" Foreground="White" Background="#1460F3" BorderThickness="0" Click="ReplyButton_Click"></Button>
+        </StackPanel>
+        
+        <ListView Grid.Row="2" x:Name="ReplyList" Margin="0,5,0,0">
+            <ListView.ItemsPanel>
+                <ItemsPanelTemplate>
+                    <VirtualizingStackPanel Background="#FAFCFF" HorizontalAlignment="Stretch" MaxHeight="200"
+                                            Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}, Converter={StaticResource SubtractionConverter}, ConverterParameter=5}"></VirtualizingStackPanel>
+                </ItemsPanelTemplate>
+            </ListView.ItemsPanel>
+            
+            <ListView.ItemTemplate>
+                <ItemContainerTemplate>
+                    <Grid Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}, Converter={StaticResource SubtractionConverter}, ConverterParameter=30}">
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="Auto"/>
+                            <RowDefinition Height="Auto"/>
+                        </Grid.RowDefinitions>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="*"/>
+                            <ColumnDefinition Width="Auto"/>
+                        </Grid.ColumnDefinitions>
+                        
+                        <DockPanel Grid.Column="0">
+                            <StackPanel VerticalAlignment="Center">
+                                <TextBlock Text="{Binding Author}" FontSize="14" Foreground="#43474D" VerticalAlignment="Center"/>
+                                <TextBlock Text="{Binding Date}" FontSize="11" Foreground="#999999" VerticalAlignment="Center"/>
+                            </StackPanel>
+                        </DockPanel>
+                        
+                        <Menu Background="Transparent" BorderThickness="0" Grid.Column="1">
+                            <MenuItem  BorderThickness="0" Width="30" Height="30" Padding="4,3,0,0">
+                                <MenuItem.Header>
+                                    <Canvas Width="30" Height="30"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
+                                        <Path Data="M10 5.5C10.8284 5.5 11.5 4.82843 11.5 4C11.5 3.17157 10.8284 2.5 10 2.5C9.17157 2.5 8.5 3.17157 8.5 4C8.5 4.82843 9.17157 5.5 10 5.5ZM11.5 10C11.5 10.8284 10.8284 11.5 10 11.5C9.17157 11.5 8.5 10.8284 8.5 10C8.5 9.17157 9.17157 8.5 10 8.5C10.8284 8.5 11.5 9.17157 11.5 10ZM11.5 16C11.5 16.8284 10.8284 17.5 10 17.5C9.17157 17.5 8.5 16.8284 8.5 16C8.5 15.1716 9.17157 14.5 10 14.5C10.8284 14.5 11.5 15.1716 11.5 16Z" 
+                                              Fill="#43474D"/>
+                                    </Canvas>
+                                </MenuItem.Header>
+                                <MenuItem Header="Edit" Style="{StaticResource Sub_MenuItem}">
+                                    <MenuItem.Command>
+                                        <pdfControlUi:ShowContentBoxCommand/>
+                                    </MenuItem.Command>
+                                    <MenuItem.CommandParameter>
+                                        <Binding ElementName="ContentBox"/>
+                                    </MenuItem.CommandParameter>
+                                </MenuItem>
+                                
+                                <MenuItem Header="Delete" Style="{StaticResource Sub_MenuItem}">
+                                    <MenuItem.Command>
+                                        <pdfControlUi:DeleteReplyCommand/>
+                                    </MenuItem.Command>
+                                    <MenuItem.CommandParameter>
+                                        <Binding Path="."></Binding>
+                                    </MenuItem.CommandParameter>
+                                </MenuItem>
+                            </MenuItem>
+                        </Menu>
+                        <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
+                            <TextBox x:Name="ContentBox" Text="{Binding Content}" FontSize="14" Foreground="#666666" Margin="5,5,0,0"
+                                     Visibility="Collapsed" VerticalAlignment="Center" LostFocus="ContentBox_LostFocus"></TextBox>
+                            
+                            <TextBlock Text="{Binding Content}" x:Name="ContentTxb" FontSize="14" Foreground="#666666" Margin="5,5,0,0" VerticalAlignment="Center"
+                                       Visibility="{Binding ElementName=ContentBox,Path=Visibility,Converter={StaticResource AntiVisibilityConverter}}"></TextBlock>
+                        </Grid>
+                        
+                    </Grid>
+                </ItemContainerTemplate>
+            </ListView.ItemTemplate>
+        </ListView>
+    </Grid>
+</UserControl>

+ 158 - 0
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/AnnotationReplyListControl.xaml.cs

@@ -0,0 +1,158 @@
+using System;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Globalization;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Input;
+using Compdfkit_Tools.PDFControl;
+using Compdfkit_Tools.Properties;
+using ComPDFKit.PDFAnnotation;
+using ComPDFKit.Tool.Help;
+
+namespace Compdfkit_Tools.PDFControlUI
+{
+    public partial class AnnotationReplyListControl : UserControl
+    {
+        public static readonly DependencyProperty ReplyListProperty = DependencyProperty.Register(
+            nameof(ReplyListSource),
+            typeof(ObservableCollection<CPDFAnnotationListUI.ReplyData>),
+            typeof(AnnotationReplyListControl),
+            new PropertyMetadata(null, OnReplyListSourceChanged));
+
+        public ObservableCollection<CPDFAnnotationListUI.ReplyData> ReplyListSource
+        {
+            get => (ObservableCollection<CPDFAnnotationListUI.ReplyData>)GetValue(ReplyListProperty);
+            set => SetValue(ReplyListProperty, value);
+        }
+
+        private static void OnReplyListSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var newReplyListSource = e.NewValue as ObservableCollection<CPDFAnnotationListUI.ReplyData>;
+            if (d is AnnotationReplyListControl control)
+            {
+                control.ReplyList.ItemsSource = newReplyListSource;
+            }
+        }
+        
+        public static event EventHandler ReplyListChanged;
+        
+        public static void InvokeReplyListChanged()
+        {
+            ReplyListChanged?.Invoke(null, EventArgs.Empty);
+        }
+        
+        public AnnotationReplyListControl()
+        {
+            InitializeComponent();
+            ReplyList.ItemsSource = ReplyListSource;
+        }
+        
+        public void SetReplyInputVisibility(bool isVisible)
+        {
+            if (isVisible)
+            {
+                ReplyGrid.RowDefinitions[0].Height = new GridLength(1, GridUnitType.Auto);
+                ReplyGrid.RowDefinitions[1].Height = new GridLength(1, GridUnitType.Auto);
+            }
+            else
+            {
+                ReplyGrid.RowDefinitions[0].Height = new GridLength(0);
+                ReplyGrid.RowDefinitions[1].Height = new GridLength(0);
+            }
+        }
+        
+        public void SetReplyListVisibility(bool isVisible)
+        {
+            ReplyGrid.RowDefinitions[2].Height = isVisible ? new GridLength(1, GridUnitType.Auto) : new GridLength(0);
+        }
+
+        private void ContentBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            if (sender is TextBox textBox)
+            {
+                textBox.Visibility = Visibility.Collapsed;
+                if(textBox.DataContext is CPDFAnnotationListUI.ReplyData replyData)
+                {
+                    replyData.ReplyAnnotation.SetContent(textBox.Text);
+                }
+            }
+        }
+
+        private void ReplyButton_Click(object sender, RoutedEventArgs e)
+        {
+            if (sender is Button button)
+            {
+                if (button.DataContext is CPDFAnnotationListUI.AnnotationBindData annotBindData)
+                {
+                    if (!string.IsNullOrEmpty(InputTxb.Text))
+                    {
+                        var replyAnnot = annotBindData.BindProperty.Annotation.CreateReplyAnnotation();
+                        replyAnnot.SetContent(InputTxb.Text);
+                        replyAnnot.SetAuthor(Helper.CommonHelper.Author);
+                        annotBindData.BindProperty.ReplyList.Add(new CPDFAnnotationListUI.ReplyData
+                        {
+                            ReplyAnnotation = replyAnnot
+                        }); 
+                        InputTxb.Text = string.Empty;
+                        InvokeReplyListChanged();
+                    }
+                }
+            }
+        }
+    }
+    
+    public class ShowContentBoxCommand : ICommand
+    {
+        public event EventHandler CanExecuteChanged;
+
+        public bool CanExecute(object parameter)
+        {
+            return true;
+        }
+
+        public void Execute(object parameter)
+        {
+            if (parameter is TextBox textBox)
+            {
+                textBox.Visibility = Visibility.Visible;
+                textBox.Focus();
+                textBox.SelectAll();
+            }
+        }
+    }
+    
+    public class DeleteReplyCommand : ICommand
+    {
+        public event EventHandler CanExecuteChanged;
+
+        public bool CanExecute(object parameter)
+        {
+            return true;
+        }
+
+        public void Execute(object parameter)
+        {
+            if (parameter is CPDFAnnotationListUI.ReplyData replyData)
+            {
+                replyData.ReplyAnnotation.RemoveAnnot();
+                AnnotationReplyListControl.InvokeReplyListChanged();
+            }
+        }
+    }
+    
+    public class AntiVisibilityConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return (Visibility)value == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return (Visibility)value == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
+        }
+    }
+}

+ 62 - 6
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/CPDFAnnoationListUI.xaml

@@ -1,14 +1,17 @@
-<UserControl x:Class="Compdfkit_Tools.PDFControlUI.CPDFAnnoationListUI"
+<UserControl x:Class="Compdfkit_Tools.PDFControlUI.CPDFAnnotationListUI"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
+             xmlns:pdfControlUi="clr-namespace:Compdfkit_Tools.PDFControlUI"
+             xmlns:compdfkitTools="clr-namespace:Compdfkit_Tools"
              mc:Ignorable="d" 
               d:DesignHeight="800" d:DesignWidth="300">
     <UserControl.Resources>
         <cpdfcommon:AnnotArgsTypeToVisibilityConverter x:Key="AnnotArgsTypeToVisibilityConverter"></cpdfcommon:AnnotArgsTypeToVisibilityConverter>
         <cpdfcommon:BotaResourceConverter x:Key="BotaResourceConverter"></cpdfcommon:BotaResourceConverter>
+        <pdfControlUi:SubtractionConverter x:Key="SubtractionConverter"/>
     </UserControl.Resources>
     <Grid>
         <ListView Name="AnnotationList" SelectionChanged="AnnotationListControl_SelectionChanged" VirtualizingPanel.IsVirtualizingWhenGrouping="True" 
@@ -41,21 +44,25 @@
 
             <ListView.ItemsPanel>
                 <ItemsPanelTemplate>
-                    <VirtualizingStackPanel Background="#FAFCFF" Margin="-5,0,0,0"></VirtualizingStackPanel>
+                    <VirtualizingStackPanel Background="#FAFCFF" Margin="-5,0,5,0" HorizontalAlignment="Stretch"
+                                            Width="{Binding ActualWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}, Converter={StaticResource SubtractionConverter}, ConverterParameter=5}"></VirtualizingStackPanel>
                 </ItemsPanelTemplate>
             </ListView.ItemsPanel>
 
             <ListView.ItemTemplate>
                 <ItemContainerTemplate>
-                    <Grid Height="auto">
+                    <Grid Margin="0,0,5,5">
                         <Grid.RowDefinitions>
                             <RowDefinition></RowDefinition>
-                            <RowDefinition Height="auto"></RowDefinition>
+                            <RowDefinition Height="Auto"></RowDefinition>
+                            <RowDefinition Height="Auto"></RowDefinition>
+                            <RowDefinition Height="Auto"></RowDefinition>
+                            <RowDefinition Height="Auto"></RowDefinition>
                         </Grid.RowDefinitions>
                         <Grid Grid.Row="0" Name="AnnotGrid">
                             <Grid.ColumnDefinitions>
                                 <ColumnDefinition Width="20"></ColumnDefinition>
-                                <ColumnDefinition></ColumnDefinition>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
                             </Grid.ColumnDefinitions>
                             <Canvas Height="16" Width="20">
                                 <Grid x:Name="HighlightGrid" Visibility="{Binding BindProperty.CurrentAnnotationType, Converter={StaticResource AnnotArgsTypeToVisibilityConverter}, ConverterParameter = C_ANNOTATION_HIGHLIGHT}">
@@ -127,9 +134,58 @@
                                     <Path Data="M1.37111 7.6963L10 1.42705L18.6289 7.6963L15.3329 17.8402H4.66705L1.37111 7.6963Z" Stroke="#43474D"></Path>
                                 </Grid>
                             </Canvas>
-                            <TextBlock Text="{Binding BindProperty.CreateDate}" Grid.Column="1" Margin="10,0,0,0"></TextBlock>
+                            <Grid Grid.Column="1" Margin="10,0,10,0">
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="*"></ColumnDefinition>
+                                    <ColumnDefinition Width="20"></ColumnDefinition>
+                                </Grid.ColumnDefinitions>
+                                <StackPanel>
+                                    <TextBlock Text="{Binding BindProperty.Author}"></TextBlock>
+                                    <TextBlock Text="{Binding BindProperty.CreateDate}" ></TextBlock>
+                                </StackPanel>
+                                <CheckBox Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
+                                    <CheckBox.Style>
+                                        <Style TargetType="CheckBox">
+                                            <Style.Triggers>
+                                                <Trigger Property="IsChecked" Value="True">
+                                                    <Setter Property="ToolTip" Value="Marked"/>
+                                                </Trigger>
+                                                <Trigger Property="IsChecked" Value="False">
+                                                    <Setter Property="ToolTip" Value="UnMarked"/>
+                                                </Trigger>
+                                            </Style.Triggers>
+                                        </Style>
+                                    </CheckBox.Style>
+                                </CheckBox>
+                            </Grid>
                         </Grid>
                         <TextBox Text="{Binding BindProperty.Note, Mode=OneWay}"  Grid.Row="1" TextWrapping="Wrap" AcceptsReturn="True" IsHitTestVisible="False" Background="Transparent" BorderThickness="0" Width="{Binding ElementName=AnnotationList,Path=ActualWidth}" Padding="16,6,16,6" FontFamily="Microsoft YaHei" FontSize="14px"></TextBox>
+                        <pdfControlUi:AnnotationReplyListControl x:Name="ReplyListControl" Grid.Row="2" ReplyListSource="{Binding BindProperty.ReplyList}"></pdfControlUi:AnnotationReplyListControl>
+                        <Grid Grid.Row="3">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="50"></ColumnDefinition>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
+                            </Grid.ColumnDefinitions>
+                            <pdfControlUi:ReplyStatusControl Grid.Column="0"></pdfControlUi:ReplyStatusControl>
+                            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
+                                <Button Width="40" Height="20" Background="Transparent" BorderThickness="0" Command="{Binding DataContext.CallReplyListMethodCommand, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}">
+                                    <StackPanel Orientation="Horizontal">
+                                        <Path Data="M16 12.3333C16 12.7017 15.8537 13.055 15.5932 13.3154C15.3327 13.5759 14.9795 13.7222 14.6111 13.7222H6.27778L3.5 16.5V5.38889C3.5 5.02053 3.64633 4.66726 3.9068 4.4068C4.16726 4.14633 4.52053 4 4.88889 4H14.6111C14.9795 4 15.3327 4.14633 15.5932 4.4068C15.8537 4.66726 16 5.02053 16 5.38889V12.3333Z" 
+                                              Stroke="#43474D" StrokeThickness="1.25" StrokeEndLineCap="Round" StrokeLineJoin="Round"/>
+                                        <TextBlock Text="4"  VerticalAlignment="Bottom" Margin="5,0,0,0"/>
+                                    </StackPanel>
+                                </Button>
+
+                                <Button Width="20" Height="20" Background="Transparent" BorderThickness="0" Margin="10,0,10,0">
+                                    <Canvas Width="20" Height="20">
+                                        <Path Data="M7.95833 8.75L4 12.7083L7.95833 16.6667" 
+                                              Stroke="#43474D" StrokeThickness="1.5" StrokeEndLineCap="Round" StrokeLineJoin="Round"/>
+                                        <Path Data="M16.6666 4V9.54166C16.6666 10.3815 16.333 11.187 15.7392 11.7808C15.1453 12.3747 14.3398 12.7083 13.5 12.7083H4" 
+                                              Stroke="#43474D" StrokeThickness="1.5" StrokeEndLineCap="Round" StrokeLineJoin="Round"/>
+                                    </Canvas>
+                                </Button>
+                            </StackPanel>
+                        </Grid>
                     </Grid>
                 </ItemContainerTemplate>
             </ListView.ItemTemplate>

+ 76 - 7
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/CPDFAnnoationListUI.xaml.cs

@@ -4,6 +4,7 @@ using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.ComponentModel;
+using System.Globalization;
 using System.Text.RegularExpressions;
 using System.Windows;
 using System.Windows.Controls;
@@ -13,14 +14,43 @@ using Compdfkit_Tools.Helper;
 
 namespace Compdfkit_Tools.PDFControlUI
 {
-    public partial class CPDFAnnoationListUI : UserControl
+    public partial class CPDFAnnotationListUI : UserControl
     {
+        public class ReplyData
+        {
+            public CPDFAnnotation ReplyAnnotation { get; set; }
+            public string Author
+            {
+                get => ReplyAnnotation.GetAuthor();
+                set => ReplyAnnotation.SetAuthor(value);
+            }
+
+            public string Date
+            {
+                get => ReplyAnnotation.GetCreationDate();
+                set => ReplyAnnotation.SetCreationDate(value);
+            }
+
+            public string Content
+            {
+                get => ReplyAnnotation.GetContent();
+                set => ReplyAnnotation.SetContent(value);
+            }
+        }
+        
         public class BindAnnotationResult : INotifyPropertyChanged
         {
+            public ObservableCollection<ReplyData> ReplyList { get; set; } = new ObservableCollection<ReplyData>();
+            
             public int PageIndex { get; set; }
 
             public int AnnotIndex { get => annotationData.AnnotIndex; }
 
+            public string Author
+            {
+                get => annotationData.Author;
+            }
+            
             public string CreateDate
             {
                 get
@@ -49,6 +79,8 @@ namespace Compdfkit_Tools.PDFControlUI
             }
 
             public AnnotParam annotationData { get; set; }
+            
+            public CPDFAnnotation Annotation { get; set; }
 
             public event PropertyChangedEventHandler PropertyChanged;
             protected void OnPropertyChanged(string propertyName)
@@ -57,14 +89,31 @@ namespace Compdfkit_Tools.PDFControlUI
             }
         }
 
-        internal class AnnotationBindData
+        public class AnnotationBindData : INotifyPropertyChanged
         {
-            public BindAnnotationResult BindProperty { get; set; }
-            public AnnotationBindData()
+            private BindAnnotationResult _bindProperty;
+
+            public BindAnnotationResult BindProperty
             {
-                BindProperty = new BindAnnotationResult();
+                get => _bindProperty;
+                set
+                {
+                    if (_bindProperty != value)
+                    {
+                        _bindProperty = value;
+                        OnPropertyChanged(nameof(BindProperty));
+                    }
+                }
             }
+
             public int ShowPageIndex { get { return BindProperty.PageIndex + 1; } set { BindProperty.PageIndex = value; } }
+
+            public event PropertyChangedEventHandler PropertyChanged;
+
+            protected virtual void OnPropertyChanged(string propertyName)
+            {
+                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+            }
         }
 
         private ObservableCollection<AnnotationBindData> annotationList = new ObservableCollection<AnnotationBindData>();
@@ -76,7 +125,7 @@ namespace Compdfkit_Tools.PDFControlUI
         private ContextMenu popContextMenu;
         private bool enableSelectEvent = true;
 
-        public CPDFAnnoationListUI()
+        public CPDFAnnotationListUI()
         {
             InitializeComponent();
             ICollectionView groupView = CollectionViewSource.GetDefaultView(annotationList);
@@ -177,7 +226,10 @@ namespace Compdfkit_Tools.PDFControlUI
                 {
                     AnnotationSelectionChanged?.Invoke(this, (e.AddedItems[0] as AnnotationBindData).BindProperty);
                 }
-                catch { }
+                catch (Exception)
+                {
+                    return;
+                }
             }
         }
          
@@ -236,4 +288,21 @@ namespace Compdfkit_Tools.PDFControlUI
             CancelSelected();
         }
     }
+    
+    public class SubtractionConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is double actualWidth && parameter is string parameterValue && double.TryParse(parameterValue, out double subtractValue))
+            {
+                return actualWidth - subtractValue;
+            }
+            return value;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return null;
+        }
+    }
 }

+ 68 - 0
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/ReplyStatusControl.xaml

@@ -0,0 +1,68 @@
+<UserControl x:Class="Compdfkit_Tools.PDFControlUI.ReplyStatusControl"
+             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:Compdfkit_Tools.PDFControlUI"
+             mc:Ignorable="d"
+             d:DesignHeight="300" d:DesignWidth="300">
+    
+
+    <UserControl.Resources>
+    <Style x:Key="MenuItemStyle" TargetType="local:PathMenuItem">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type local:PathMenuItem}">
+                    <Border x:Name="border"
+                            Background="#FFFFFF"
+                            BorderThickness="0"
+                            Height="40">
+                        <Grid Margin="20,0,20,0">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="Auto"></ColumnDefinition>
+                                <ColumnDefinition Width="Auto"></ColumnDefinition>
+                            </Grid.ColumnDefinitions>
+                            <ContentPresenter x:Name="IconPresenter"
+                                              ContentSource="IconPath"
+                                              Grid.Column="0">
+                            </ContentPresenter>
+                            <ContentPresenter x:Name="contentPresenter"
+                                              Grid.Column="1"
+                                              ContentSource="Header"
+                                              TextBlock.Foreground="#000000"
+                                              TextBlock.FontFamily="SegoeUI"
+                                              TextBlock.FontSize="15"
+                                              Margin="10,0,0,0"
+                                              HorizontalAlignment="Left"
+                                              VerticalAlignment="Center">
+                            </ContentPresenter>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="TextBlock.Foreground" TargetName="contentPresenter" Value="#6A6A6A"></Setter>
+                            <Setter TargetName="border" Property="Background" Value="#EFEFEF"></Setter>
+                        </Trigger>
+                        <Trigger Property="IsHighlighted" Value="True">
+                            <Setter Property="Background" TargetName="border" Value="#2894FF"></Setter>
+                            <Setter Property="BorderBrush" TargetName="border" Value="#2894FF"></Setter>
+                            <Setter Property="TextBlock.Foreground" TargetName="contentPresenter" Value="#FFFFFF"></Setter>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</UserControl.Resources>
+    <Grid Height="auto">
+        <Grid Height="30" Width="30">
+            <Menu Background="Transparent">
+                <local:PathMenuItem x:Name="IconMenu" Height="30" Width="30" Margin="0" Padding="0">
+                    <local:PathMenuItem.Header>
+                        <Grid x:Name="ButtonIcon" Height="30" Width="30"></Grid>
+                    </local:PathMenuItem.Header>
+                </local:PathMenuItem>
+            </Menu>
+        </Grid>
+    </Grid>
+</UserControl>

文件差异内容过多而无法显示
+ 137 - 0
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationList/PDFAnnotationListUI/ReplyStatusControl.xaml.cs


+ 1 - 0
Demo/Examples/Compdfkit_Tools/Common/Helper/CommonHelper.cs

@@ -59,6 +59,7 @@ namespace Compdfkit_Tools.Helper
 
     public static class CommonHelper
     {
+        public static string Author { set; get; }
         public static bool IsImageCorrupted(string imagePath)
         {
             try

+ 17 - 9
Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj

@@ -118,8 +118,14 @@
     <Compile Include="Annotation\PDFAnnotationList\PDFAnnotationListControl\CPDFAnnotationListControl.xaml.cs">
       <DependentUpon>CPDFAnnotationListControl.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\CPDFAnnoationListUI.xaml.cs">
-      <DependentUpon>CPDFAnnoationListUI.xaml</DependentUpon>
+    <Compile Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\AnnotationReplyListControl.xaml.cs">
+      <DependentUpon>AnnotationReplyListControl.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\CPDFAnnotationListUI.xaml.cs">
+      <DependentUpon>CPDFAnnotationListUI.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\ReplyStatusControl.xaml.cs">
+      <DependentUpon>ReplyStatusControl.xaml</DependentUpon>
     </Compile>
     <Compile Include="Annotation\PDFAnnotationPanel\PDFAnnotationUI\CPDFFreehandUI.xaml.cs">
       <DependentUpon>CPDFFreehandUI.xaml</DependentUpon>
@@ -748,10 +754,12 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\CPDFAnnoationListUI.xaml">
+    <Page Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\AnnotationReplyListControl.xaml" />
+    <Page Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\CPDFAnnotationListUI.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Annotation\PDFAnnotationList\PDFAnnotationListUI\ReplyStatusControl.xaml" />
     <Page Include="Annotation\PDFAnnotationPanel\PDFAnnotationUI\CPDFFreehandUI.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1303,18 +1311,18 @@
     </Page>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\..\..\ComPDFKit-ForRebuild\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
-      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
-      <Name>ComPDFKit.Desk</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\..\ComPDFKit-Rebuild\ComPDFKit.Tool\ComPDFKit.Tool.csproj">
+    <ProjectReference Include="..\..\..\..\compdfkit_rebuild\ComPDFKit.Tool\ComPDFKit.Tool.csproj">
       <Project>{a061ee7a-6704-4bd9-86ee-48ed5df75e2f}</Project>
       <Name>ComPDFKit.Tool</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\..\ComPDFKit-Rebuild\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
+    <ProjectReference Include="..\..\..\..\compdfkit_rebuild\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
       <Project>{783263cf-0da3-4095-9df8-2c4a6b3ff908}</Project>
       <Name>ComPDFKit.Viewer</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\..\compdfkit_windows\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Net.csproj">
+      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
+      <Name>ComPDFKit.Desk</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 1 - 0
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -200,6 +200,7 @@ namespace PDFViewer
                 pdfviewer.SetLinkHighlight(Properties.Settings.Default.IsHighlightLinkArea);
                 pdfviewer.SetFormFieldHighlight(Properties.Settings.Default.IsHighlightFormArea);
                 pdfviewer.ScrollStride = Properties.Settings.Default.Divisor;
+                Compdfkit_Tools.Helper.CommonHelper.Author = Properties.Settings.Default.DocumentAuthor;
             }
         }