Przeglądaj źródła

compdfkit(win) - 测量Demo 属性面板UI

zhuyi 1 rok temu
rodzic
commit
045d01e952

+ 29 - 0
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFMeasureBarControl.xaml.cs

@@ -73,6 +73,7 @@ namespace Compdfkit_Tools.PDFControl
         #endregion
 
         #region Create Default UI
+
         public CPDFMeasureBarControl()
         {
             InitializeComponent();
@@ -189,12 +190,16 @@ namespace Compdfkit_Tools.PDFControl
                     case MeasureType.UnKnown:
                         break;
                     case MeasureType.Straightness:
+                        CreateStraightness();
                         break;
                     case MeasureType.Multiline:
+                        CreateMultiline();
                         break;
                     case MeasureType.Polygonal:
+                        CreatePolygonal();
                         break;
                     case MeasureType.Rectangles:
+                        CreateRectangles();
                         break;
                     default:
                         break;
@@ -208,5 +213,29 @@ namespace Compdfkit_Tools.PDFControl
         }
 
         #endregion
+
+        #region Create Form
+
+        private void CreateStraightness()
+        {
+
+        }
+
+        private void CreateMultiline()
+        {
+
+        }
+
+        private void CreatePolygonal()
+        {
+
+        }
+
+        private void CreateRectangles()
+        {
+
+        }
+
+        #endregion
     }
 }

+ 28 - 0
Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj

@@ -329,6 +329,18 @@
     <Compile Include="Measure\MeasurePropertyControl.xaml.cs">
       <DependentUpon>MeasurePropertyControl.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Measure\Property\MultilineProperty.xaml.cs">
+      <DependentUpon>MultilineProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Measure\Property\PolygonalProperty.xaml.cs">
+      <DependentUpon>PolygonalProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Measure\Property\RectanglesProperty.xaml.cs">
+      <DependentUpon>RectanglesProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Measure\Property\StraightnessProperty.xaml.cs">
+      <DependentUpon>StraightnessProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="PageEdit\PageEditControl\PageEditControl.xaml.cs">
       <DependentUpon>PageEditControl.xaml</DependentUpon>
     </Compile>
@@ -831,6 +843,22 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Measure\Property\MultilineProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Measure\Property\PolygonalProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Measure\Property\RectanglesProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Measure\Property\StraightnessProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="PageEdit\PageEditControl\PageEditControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 2 - 1
Demo/Examples/Compdfkit_Tools/Measure/MeasureControl.xaml

@@ -6,7 +6,8 @@
              xmlns:local="clr-namespace:Compdfkit_Tools.Measure"
              mc:Ignorable="d" 
              xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl"
-             xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
+             xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"    
+             Loaded="UserControl_Loaded"
              d:DesignHeight="450" d:DesignWidth="800">
     <UserControl.Resources>
         <ResourceDictionary>

+ 24 - 6
Demo/Examples/Compdfkit_Tools/Measure/MeasureControl.xaml.cs

@@ -24,10 +24,10 @@ namespace Compdfkit_Tools.Measure
     /// </summary>
     public partial class MeasureControl : UserControl
     {
-        public PDFViewControl PdfViewControl = new PDFViewControl();
-        public MeasurePropertyControl FromPropertyControl = new MeasurePropertyControl();
+        public MeasurePropertyControl measurePropertyControl = new MeasurePropertyControl();
         private CPDFDisplaySettingsControl displaySettingsControl;
 
+        private PDFViewControl PdfViewControl = new PDFViewControl();
 
         private PanelState panelState = PanelState.GetInstance();
 
@@ -37,10 +37,11 @@ namespace Compdfkit_Tools.Measure
         }
         #region Init PDFViewer
 
-        public void InitWithPDFViewer(CPDFViewer pdfViewer)
+        public void InitWithPDFViewer(PDFViewControl pdfViewControl, CPDFViewer pdfViewer)
         {
+            PdfViewControl=pdfViewControl;
             PdfViewControl.PDFView = pdfViewer;
-            PDFMeasureTool.InitWithPDFViewer(pdfViewer, FromPropertyControl);
+            PDFMeasureTool.InitWithPDFViewer(pdfViewer, measurePropertyControl);
             FloatPageTool.InitWithPDFViewer(pdfViewer);
             PDFGrid.Child = PdfViewControl;
 
@@ -52,6 +53,18 @@ namespace Compdfkit_Tools.Measure
             displaySettingsControl = cPDFDisplaySettingsControl;
         }
 
+        public void ClearAllToolState()
+        {
+            PDFMeasureTool.ClearAllToolState();
+        }
+        public void ClearViewerControl()
+        {
+            PDFGrid.Child = null;
+            BotaContainer.Child = null;
+            PropertyContainer.Child = null;
+            displaySettingsControl=null;
+        }
+
         private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
         {
             if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
@@ -62,7 +75,7 @@ namespace Compdfkit_Tools.Measure
             {
                 if (panelState.RightPanel == PanelState.RightPanelState.PropertyPanel)
                 {
-                    ExpandRightPropertyPanel(FromPropertyControl, Visibility.Visible);
+                    ExpandRightPropertyPanel(measurePropertyControl, Visibility.Visible);
                 }
                 else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
                 {
@@ -81,7 +94,7 @@ namespace Compdfkit_Tools.Measure
 
         public void ExpandRightPropertyPanel(Visibility visible)
         {
-            ExpandRightPropertyPanel(FromPropertyControl, visible);
+            ExpandRightPropertyPanel(measurePropertyControl, visible);
         }
 
         public void ExpandNullRightPropertyPanel(Visibility visible)
@@ -124,5 +137,10 @@ namespace Compdfkit_Tools.Measure
         }
 
         #endregion
+
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 38 - 3
Demo/Examples/Compdfkit_Tools/Measure/MeasurePropertyControl.xaml.cs

@@ -1,4 +1,6 @@
-using ComPDFKitViewer.AnnotEvent;
+using Compdfkit_Tools.Measure.Property;
+using Compdfkit_Tools.PDFControl;
+using ComPDFKitViewer.AnnotEvent;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -21,14 +23,47 @@ namespace Compdfkit_Tools.Measure
     /// </summary>
     public partial class MeasurePropertyControl : UserControl
     {
+        private UIElement currentPanel = null;
         public MeasurePropertyControl()
         {
             InitializeComponent();
+
+            //MultilineProperty pushButtonProperty2 = new MultilineProperty();
+            //MeasurePropertyPanel.Child = pushButtonProperty2;
+        }
+
+        public void SetPropertyForType(AnnotHandlerEventArgs Args, AnnotAttribEvent e)
+        {
+            currentPanel = null;
+            if (Args == null)
+            {
+                SetMeasurePanel(currentPanel);
+                return;
+            }
+
+            switch (Args.EventType)
+            {
+                case AnnotArgsType.LineMeasure:
+                    MultilineProperty multilineProperty = new MultilineProperty();
+                    currentPanel = multilineProperty;
+                    break;
+                case AnnotArgsType.PolyLineMeasure:
+                    PolygonalProperty polygonalProperty = new PolygonalProperty();
+                    currentPanel = polygonalProperty;
+                    break;
+                case AnnotArgsType.PolygonMeasure:
+                    RectanglesProperty rectanglesProperty = new RectanglesProperty();
+                    currentPanel = rectanglesProperty;
+                    break;
+                default:
+                    break;
+            }
+            SetMeasurePanel(currentPanel);
         }
 
-        public void SetPropertyForType(WidgetArgs Args, AnnotAttribEvent e)
+        private void SetMeasurePanel(UIElement newChild)
         {
-            
+            MeasurePropertyPanel.Child = newChild;
         }
     }
 }

+ 67 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/MultilineProperty.xaml

@@ -0,0 +1,67 @@
+<UserControl x:Class="Compdfkit_Tools.Measure.Property.MultilineProperty"
+             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.Measure.Property" xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common" xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl"
+             mc:Ignorable="d"  >
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <ScrollViewer VerticalScrollBarVisibility="Auto">
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitleTextBlock" Text="Line"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontWeight="Bold" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Height="68" Margin="5">
+                    <TextBlock Text="Line Color" FontWeight="SemiBold" FontSize="14" LineHeight="16"  FontFamily="Segoe UI"/>
+                    <cpdfcommon:ColorPickerControl Margin="0,8,0,0" x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="68" Margin="5">
+                    <TextBlock Text="Opacity" FontWeight="SemiBold" FontSize="14" LineHeight="16"  FontFamily="Segoe UI"/>
+                    <cpdfcommon:CPDFOpacityControl Margin="0,8,0,0" x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+                <StackPanel Height="68" Margin="5">
+                    <TextBlock Text="Line Width" FontWeight="SemiBold" FontSize="14" LineHeight="16"  FontFamily="Segoe UI"></TextBlock>
+                    <cpdfcommon:CPDFThicknessControl Margin="0,8,0,0" x:Name="CPDFThicknessControl"></cpdfcommon:CPDFThicknessControl>
+                </StackPanel>
+                <StackPanel x:Name="LineStyleStackPanel" Height="90" Margin="5">
+                    <TextBlock Text="Line and Border Style" FontWeight="SemiBold" FontSize="14" LineHeight="16"  FontFamily="Segoe UI"/>
+                    <cpdfcommon:CPDFLineStyleControl Margin="0,8,0,0" x:Name="CPDFLineStyleControl"></cpdfcommon:CPDFLineStyleControl>
+                </StackPanel>
+                <StackPanel x:Name="FontColorStackPanel" Height="75" Margin="5">
+                    <TextBlock Text="Font Color" FontWeight="SemiBold" FontSize="14" LineHeight="16"  FontFamily="Segoe UI"/>
+                    <cpdfcommon:ColorPickerControl Margin="0,8,0,0" x:Name="FillColorPickerControl" Brush="Transparent"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Margin="5">
+                    <TextBlock  Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Text" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold" />
+                    <ComboBox x:Name="FontCombox" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontCombox_SelectionChanged">
+                        <ComboBoxItem Content="Arial"/>
+                        <ComboBoxItem Content="Courier New"/>
+                        <ComboBoxItem Content="Times New Roman"/>
+                    </ComboBox>
+                    <StackPanel Orientation="Horizontal"  >
+                        <ComboBox x:Name="FontStyleCombox"  Margin="0,8,0,0" Width="148" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontStyleCombox_SelectionChanged">
+                            <ComboBoxItem Content="Regular"/>
+                            <ComboBoxItem Content="Bold"/>
+                            <ComboBoxItem Content="Italic"/>
+                            <ComboBoxItem Content="Bold Italic"/>
+                        </ComboBox>
+                        <ComboBox x:Name="FontSizeCombox" Margin="4,8,0,0" Width="80" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontSizeCombox_SelectionChanged"/>
+                    </StackPanel>
+                </StackPanel>
+                <StackPanel Height="160" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="100"  x:Name="NoteTextBox"  TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+    </ScrollViewer>
+</UserControl>

+ 48 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/MultilineProperty.xaml.cs

@@ -0,0 +1,48 @@
+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 Compdfkit_Tools.Measure.Property
+{
+    /// <summary>
+    /// MultilineProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class MultilineProperty : UserControl
+    {
+        public MultilineProperty()
+        {
+            InitializeComponent();
+        }
+
+        private void NoteTextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+
+        private void FontStyleCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontSizeCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+    }
+}

+ 73 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/PolygonalProperty.xaml

@@ -0,0 +1,73 @@
+<UserControl x:Class="Compdfkit_Tools.Measure.Property.PolygonalProperty"
+             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.Measure.Property" xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl" xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
+             mc:Ignorable="d" 
+             d:DesignHeight="4550" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <ScrollViewer VerticalScrollBarVisibility="Auto">
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitleTextBlock"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Line Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Line Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="LineColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFLineOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+                <StackPanel x:Name="LineStyleStackPanel" Height="90" Margin="5">
+                    <TextBlock Text="Line and Border Style"></TextBlock>
+                    <cpdfcommon:CPDFLineStyleControl x:Name="CPDFLineStyleControl"></cpdfcommon:CPDFLineStyleControl>
+                </StackPanel>
+                <StackPanel x:Name="FontColorStackPanel" Height="75" Margin="5">
+                    <TextBlock Text="Font Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="FillColorPickerControl" Brush="Transparent"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel>
+                    <TextBlock  Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Text" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold" />
+                    <ComboBox x:Name="FontCombox" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontCombox_SelectionChanged">
+                        <ComboBoxItem Content="Arial"/>
+                        <ComboBoxItem Content="Courier New"/>
+                        <ComboBoxItem Content="Times New Roman"/>
+                    </ComboBox>
+                    <StackPanel Orientation="Horizontal" >
+                        <ComboBox x:Name="FontStyleCombox"  Margin="0,8,0,0" Width="148" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontStyleCombox_SelectionChanged">
+                            <ComboBoxItem Content="Regular"/>
+                            <ComboBoxItem Content="Bold"/>
+                            <ComboBoxItem Content="Italic"/>
+                            <ComboBoxItem Content="Bold Italic"/>
+                        </ComboBox>
+                        <ComboBox x:Name="FontSizeCombox" Margin="4,8,0,0" Width="72" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontSizeCombox_SelectionChanged"/>
+                    </StackPanel>
+                </StackPanel>
+                <StackPanel Height="160" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="100"  x:Name="NoteTextBox"  TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+    </ScrollViewer>
+</UserControl>

+ 48 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/PolygonalProperty.xaml.cs

@@ -0,0 +1,48 @@
+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 Compdfkit_Tools.Measure.Property
+{
+    /// <summary>
+    /// PolygonalProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class PolygonalProperty : UserControl
+    {
+        public PolygonalProperty()
+        {
+            InitializeComponent();
+        }
+
+        private void NoteTextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+
+        private void FontStyleCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontSizeCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+    }
+}

+ 73 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/RectanglesProperty.xaml

@@ -0,0 +1,73 @@
+<UserControl x:Class="Compdfkit_Tools.Measure.Property.RectanglesProperty"
+             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.Measure.Property" xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
+             mc:Ignorable="d" 
+             d:DesignHeight="4550" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <ScrollViewer VerticalScrollBarVisibility="Auto">
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitleTextBlock" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Line Color" ></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Line Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="LineColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFLineOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+                <StackPanel x:Name="LineStyleStackPanel" Height="90" Margin="5">
+                    <TextBlock Text="Line and Border Style"></TextBlock>
+                    <cpdfcommon:CPDFLineStyleControl x:Name="CPDFLineStyleControl"></cpdfcommon:CPDFLineStyleControl>
+                </StackPanel>
+                <StackPanel x:Name="FontColorStackPanel" Height="75" Margin="5">
+                    <TextBlock Text="Font Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="FillColorPickerControl" Brush="Transparent"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel>
+                    <TextBlock  Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Text" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold" />
+                    <ComboBox x:Name="FontCombox" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontCombox_SelectionChanged">
+                        <ComboBoxItem Content="Arial"/>
+                        <ComboBoxItem Content="Courier New"/>
+                        <ComboBoxItem Content="Times New Roman"/>
+                    </ComboBox>
+                    <StackPanel Orientation="Horizontal" >
+                        <ComboBox x:Name="FontStyleCombox"  Margin="0,8,0,0" Width="148" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontStyleCombox_SelectionChanged">
+                            <ComboBoxItem Content="Regular"/>
+                            <ComboBoxItem Content="Bold"/>
+                            <ComboBoxItem Content="Italic"/>
+                            <ComboBoxItem Content="Bold Italic"/>
+                        </ComboBox>
+                        <ComboBox x:Name="FontSizeCombox" Margin="4,8,0,0" Width="72" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontSizeCombox_SelectionChanged"/>
+                    </StackPanel>
+                </StackPanel>
+                <StackPanel Height="160" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="100"  x:Name="NoteTextBox"  TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+    </ScrollViewer>
+</UserControl>

+ 48 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/RectanglesProperty.xaml.cs

@@ -0,0 +1,48 @@
+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 Compdfkit_Tools.Measure.Property
+{
+    /// <summary>
+    /// RectanglesProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class RectanglesProperty : UserControl
+    {
+        public RectanglesProperty()
+        {
+            InitializeComponent();
+        }
+
+        private void NoteTextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+
+        private void FontStyleCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontSizeCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+    }
+}

+ 72 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/StraightnessProperty.xaml

@@ -0,0 +1,72 @@
+<UserControl x:Class="Compdfkit_Tools.Measure.Property.StraightnessProperty"
+             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.Measure.Property" xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common" xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="4550" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <ScrollViewer VerticalScrollBarVisibility="Auto">
+        <Grid Background="#FAFCFF">
+            <StackPanel Orientation="Vertical">
+                <Border BorderThickness="1" BorderBrush="#1A000000">
+                    <Grid  Height="40" Background="White" >
+                        <TextBlock x:Name="TitleTextBlock"  HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
+                    </Grid>
+                </Border>
+                <StackPanel Height="75" Margin="5">
+                    <TextBlock Text="Line Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="BorderColorPickerControl" Brush="Red" TransparentBtnProperty ="Collapsed"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Opacity"></TextBlock>
+                    <cpdfcommon:CPDFOpacityControl x:Name="CPDFOpacityControl"></cpdfcommon:CPDFOpacityControl>
+                </StackPanel>
+                <StackPanel Height="60" Margin="5">
+                    <TextBlock Text="Line Width"></TextBlock>
+                    <cpdfcommon:CPDFThicknessControl x:Name="CPDFThicknessControl"></cpdfcommon:CPDFThicknessControl>
+                </StackPanel>
+                <StackPanel x:Name="LineStyleStackPanel" Height="90" Margin="5">
+                    <TextBlock Text="Line and Border Style"></TextBlock>
+                    <cpdfcommon:CPDFLineStyleControl x:Name="CPDFLineStyleControl"></cpdfcommon:CPDFLineStyleControl>
+                </StackPanel>
+                <StackPanel x:Name="ArrowStackPanel" Visibility="Visible" Height="75"  Margin="5">
+                    <TextBlock Text="Start and End"></TextBlock>
+                    <cpdfcommon:CPDFArrowControl x:Name="CPDFArrowControl"></cpdfcommon:CPDFArrowControl>
+                </StackPanel>
+                <StackPanel x:Name="FontColorStackPanel" Height="75" Margin="5">
+                    <TextBlock Text="Font Color"></TextBlock>
+                    <cpdfcommon:ColorPickerControl x:Name="FillColorPickerControl" Brush="Transparent"></cpdfcommon:ColorPickerControl>
+                </StackPanel>
+                <StackPanel>
+                    <TextBlock  Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Text" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold" />
+                    <ComboBox x:Name="FontCombox" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontCombox_SelectionChanged">
+                        <ComboBoxItem Content="Arial"/>
+                        <ComboBoxItem Content="Courier New"/>
+                        <ComboBoxItem Content="Times New Roman"/>
+                    </ComboBox>
+                    <StackPanel Orientation="Horizontal" >
+                        <ComboBox x:Name="FontStyleCombox"  Margin="0,8,0,0" Width="148" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontStyleCombox_SelectionChanged">
+                            <ComboBoxItem Content="Regular"/>
+                            <ComboBoxItem Content="Bold"/>
+                            <ComboBoxItem Content="Italic"/>
+                            <ComboBoxItem Content="Bold Italic"/>
+                        </ComboBox>
+                        <ComboBox x:Name="FontSizeCombox" Margin="4,8,0,0" Width="72" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontSizeCombox_SelectionChanged"/>
+                    </StackPanel>
+                </StackPanel>
+                <StackPanel Height="160" Margin="5">
+                    <TextBlock Text="Note"></TextBlock>
+                    <TextBox Height="100"  x:Name="NoteTextBox"  TextChanged="NoteTextBox_TextChanged" TextWrapping="Wrap" AcceptsReturn="True"></TextBox>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+    </ScrollViewer>
+</UserControl>

+ 48 - 0
Demo/Examples/Compdfkit_Tools/Measure/Property/StraightnessProperty.xaml.cs

@@ -0,0 +1,48 @@
+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 Compdfkit_Tools.Measure.Property
+{
+    /// <summary>
+    /// StraightnessProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class StraightnessProperty : UserControl
+    {
+        public StraightnessProperty()
+        {
+            InitializeComponent();
+        }
+
+        private void NoteTextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+
+        }
+
+        private void FontStyleCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+
+        private void FontSizeCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+        }
+    }
+}

+ 4 - 0
Demo/Examples/Measure/MainWindow.xaml

@@ -272,7 +272,11 @@
 
                 <Grid Grid.Column="2" >
                     <Border x:Name="PDFGrid" Background="#CECECE"></Border>
+
+                    <cpdfcommon:PageNumberControl Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
                 </Grid>
+
+                <Border Name="PropertyContainer" Grid.Column="3" Visibility="Hidden"></Border>
             </Grid>
         </Grid>
 

+ 25 - 24
Demo/Examples/Measure/MainWindow.xaml.cs

@@ -82,7 +82,7 @@ namespace Measure
             pdfViewControl.PDFView?.SetMouseMode(MouseModes.Viewer);
             pdfViewControl.PDFView?.Load();
             pdfViewControl.PDFView?.SetShowLink(true);
-            PDFGrid.Child = pdfViewControl;
+
             pdfViewControl.PDFView.InfoChanged -= PdfViewer_InfoChanged;
             pdfViewControl.PDFView.InfoChanged += PdfViewer_InfoChanged;
             pdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
@@ -181,6 +181,7 @@ namespace Measure
 
         private void ExpandSearchBtn_Click(object sender, RoutedEventArgs e)
         {
+            LeftToolPanelButton.IsChecked = true;
             ExpandLeftPanel(true);
             BotaSideTool.SelectBotaTool(BOTATools.Search);
         }
@@ -264,7 +265,7 @@ namespace Measure
             {
                 if (RightPanelButton.IsChecked == true)
                 {
-                    if (measureControl.FromPropertyControl != null)
+                    if (measureControl.measurePropertyControl != null)
                     {
                         measureControl.ExpandRightPropertyPanel(Visibility.Visible);
                         if ((bool)ViewSettingBtn.IsChecked)
@@ -794,35 +795,35 @@ namespace Measure
 
         private void LoadMeasureRes()
         {
+            PDFGrid.Child = null;
+            RightPanelButton.Visibility = Visibility.Visible;
+            PDFGrid.Child = measureControl;
             displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
-            measureControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            measureControl.InitWithPDFViewer(pdfViewControl, pdfViewControl.PDFView);
             measureControl.SetSettingsControl(displayPanel);
-            PDFGrid.Child = measureControl;
         }
 
         private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             var item = (sender as ComboBox).SelectedItem as ComboBoxItem;
-            //if ((string)item.Content == "Viewer")
-            //{
-            //    measureControl.ClearAllToolState();
-            //    measureControl.SetToolBarContainerVisibility(Visibility.Collapsed);
-            //    measureControl.ExpandRightPropertyPanel(null, Visibility.Collapsed);
-            //    //formControl.FromPropertyControl.AnnotationCancel();
-            //    RightPanelButton.IsChecked = false;
-            //    if (measureControl.PdfViewControl != null && measureControl.PdfViewControl.PDFView != null)
-            //    {
-            //        measureControl.PdfViewControl.PDFView.SetMouseMode(MouseModes.Viewer);
-            //    }
-            //}
-            //else if ((string)item.Content == "Form")
-            //{
-            //    measureControl.SetToolBarContainerVisibility(Visibility.Visible);
-            //    if (measureControl.PdfViewControl != null && measureControl.PdfViewControl.PDFView != null)
-            //    {
-            //        measureControl.PdfViewControl.PDFView.SetMouseMode(MouseModes.FormEditTool);
-            //    }
-            //}
+            if ((string)item.Content == "Viewer")
+            {
+                measureControl.ClearAllToolState();
+                measureControl.ExpandNullRightPropertyPanel(Visibility.Collapsed);
+                //formControl.FromPropertyControl.AnnotationCancel();
+                RightPanelButton.IsChecked = false;
+                if (pdfViewControl != null && pdfViewControl.PDFView != null)
+                {
+                    pdfViewControl.PDFView.SetMouseMode(MouseModes.Viewer);
+                }
+                RightPanelButton.Visibility=Visibility.Collapsed;
+                measureControl.ClearViewerControl();
+                PDFGrid.Child = pdfViewControl;
+            }
+            else if ((string)item.Content == "Measure")
+            {
+                LoadMeasureRes();
+            }
         }