Browse Source

阅读页 选中文本 便签注释

OYXH\oyxh 2 năm trước cách đây
mục cha
commit
93a283aa5c

+ 3 - 2
PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml

@@ -567,7 +567,8 @@
             x:Name="thicknessText"
             Margin="0,0,0,10"
             FontFamily="Segoe UI"
-            FontSize="14" Foreground="{StaticResource color.sys.text.neutral.lv2}"
+            FontSize="14"
+            Foreground="{StaticResource color.sys.text.neutral.lv2}"
             LineHeight="20">
             Thickness
         </TextBlock>
@@ -587,8 +588,8 @@
                 IsSnapToTickEnabled="True"
                 Maximum="24"
                 Minimum="0"
-                Style="{DynamicResource RoundThumbSlider}"
                 PreviewMouseMove="ThicknessSlider_PreviewMouseMove"
+                Style="{DynamicResource RoundThumbSlider}"
                 TickFrequency="1"
                 Value="{Binding ElementName=usercontrol, Path=Value}">
                 <Slider.Resources>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 10 - 5
PDF Office/CustomControl/CompositeControl/SlidContent.xaml


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

@@ -79,6 +79,7 @@ namespace PDF_Office.Model
         public static string AnnotationCleanState = "AnnotationCleanState";
 
         public static string StickyAnnotArgs = "StickyAnnotArgs";
+        public static string AnnotCommandArgs = "AnnotCommandArgs";
 
         /// <summary>
         /// 底部工具栏

+ 95 - 37
PDF Office/Styles/ContextMenuStyle.xaml

@@ -1,7 +1,7 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:mainpage="clr-namespace:PDF_Office.Strings.MainPage"
-                    >
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:mainpage="clr-namespace:PDF_Office.Strings.MainPage">
     <!--  快捷工具展开收缩  -->
     <ContextMenu x:Key="ExpendToolsContextMenu" FontSize="14">
         <MenuItem
@@ -22,7 +22,7 @@
             IsEnabled="True" />
     </ContextMenu>
 
-    <!--便签ToolTip-->
+    <!--  便签ToolTip  -->
     <Style x:Key="FlowToolTip" TargetType="ToolTip">
         <Setter Property="HorizontalAlignment" Value="Left" />
         <Setter Property="VerticalAlignment" Value="Top" />
@@ -30,17 +30,26 @@
             <Setter.Value>
                 <ControlTemplate>
                     <Grid>
-                        <Border Background="{StaticResource color.sys.layout.dark.bg}" CornerRadius="4" BorderBrush="{StaticResource color.sys.layout.dark.bg}" BorderThickness="4">
+                        <Border
+                            Background="{StaticResource color.sys.layout.dark.bg}"
+                            BorderBrush="{StaticResource color.sys.layout.dark.bg}"
+                            BorderThickness="4"
+                            CornerRadius="4">
                             <Border.Effect>
-                                <DropShadowEffect Direction="0" BlurRadius="7" ShadowDepth="0" Color="Black" Opacity="0.09" />
+                                <DropShadowEffect
+                                    BlurRadius="7"
+                                    Direction="0"
+                                    Opacity="0.09"
+                                    ShadowDepth="0"
+                                    Color="Black" />
                             </Border.Effect>
                         </Border>
                         <TextBlock
                             Margin="16,8,16,8"
                             FontSize="13"
-                            TextWrapping="Wrap"
                             Foreground="{StaticResource color.sys.text.anti.norm}"
-                            Text="{TemplateBinding ContentControl.Content}" />
+                            Text="{TemplateBinding ContentControl.Content}"
+                            TextWrapping="Wrap" />
                     </Grid>
                 </ControlTemplate>
             </Setter.Value>
@@ -52,7 +61,10 @@
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="MenuItem">
-                    <Grid Height="24" Background="#FBFBFD" Width="{TemplateBinding Width}">
+                    <Grid
+                        Width="{TemplateBinding Width}"
+                        Height="24"
+                        Background="#FBFBFD">
                         <ContentPresenter Content="{TemplateBinding Header}" />
                     </Grid>
                 </ControlTemplate>
@@ -61,7 +73,10 @@
     </Style>
 
     <!--  注释-内容选择-右键菜单  -->
-    <ContextMenu x:Key="SnapshotContextMenu" FontSize="14" Background="{StaticResource color.sys.layout.mg}">
+    <ContextMenu
+        x:Key="SnapshotContextMenu"
+        Background="{StaticResource color.sys.layout.mg}"
+        FontSize="14">
 
         <MenuItem
             Name="BtnSnapCopy"
@@ -161,26 +176,26 @@
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_AddComment}" Tag="AddAnnotation">
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Freehand}" Tag="AnnotFreehand"  />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Freehand}" Tag="AnnotFreehand" />
             <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Text}" Tag="AnnotFreeText" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Note}" Tag="AnnotSticky"/>
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Note}" Tag="AnnotSticky" />
             <Separator
                 Height="1"
                 BorderBrush="#33000000"
                 BorderThickness="1"
                 Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Rectangle}" Tag="AnnotSquare"  />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Oval}" Tag="AnnotCircle"  />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Arrow}" Tag="AnnotArrow"  />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_StraightLine}" Tag="AnnotLine"  />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Rectangle}" Tag="AnnotSquare" />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Oval}" Tag="AnnotCircle" />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Arrow}" Tag="AnnotArrow" />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_StraightLine}" Tag="AnnotLine" />
             <Separator
                 Height="1"
                 BorderBrush="#33000000"
                 BorderThickness="1"
                 Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Link}" Tag="AnnotLink"  />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Stamp}" Tag="AnnotStamp"  />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Signature}" Tag="AnnotAutograph"  />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Link}" Tag="AnnotLink" />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Stamp}" Tag="AnnotStamp" />
+            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Signature}" Tag="AnnotAutograph" />
         </MenuItem>
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_HideAnnotations}" Tag="HiddenAnnot" />
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_ShowAnnotations}" Tag="DisplayAnnot" />
@@ -192,17 +207,28 @@
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
         <MenuItem Header="工具模式" Tag="ToolMode">
-            <MenuItem Header="默认工具" Tag="default" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_ScrollTool}" Tag="roll" IsCheckable="True" />
+            <MenuItem
+                Header="默认工具"
+                IsCheckable="True"
+                Tag="default" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_ScrollTool}"
+                IsCheckable="True"
+                Tag="roll" />
             <MenuItem
                 Header="放大镜"
+                IsCheckable="True"
                 Tag="magnifier"
-                Visibility="Collapsed" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_ContentSelection}" Tag="content" IsCheckable="True" />
+                Visibility="Collapsed" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_ContentSelection}"
+                IsCheckable="True"
+                Tag="content" />
             <MenuItem
                 Header="{x:Static mainpage:MainPage.ViewRightMenu_AreaZoom}"
+                IsCheckable="True"
                 Tag="zoom"
-                Visibility="Collapsed" IsCheckable="True" />
+                Visibility="Collapsed" />
         </MenuItem>
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_OnReadMode}" Tag="ReadModel" />
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_OutReadMode}" Tag="UnReadModel" />
@@ -212,21 +238,53 @@
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_Zoom}" Tag="ViewZoom">
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_FitWidth}" Tag="FitWidth" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_FitPage}" Tag="FitHeight" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_ActualSize}" Tag="FitSize" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_ZoomIn}" Tag="enlarge" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_ZoomOut}" Tag="narrow" IsCheckable="True" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_FitWidth}"
+                IsCheckable="True"
+                Tag="FitWidth" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_FitPage}"
+                IsCheckable="True"
+                Tag="FitHeight" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_ActualSize}"
+                IsCheckable="True"
+                Tag="FitSize" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_ZoomIn}"
+                IsCheckable="True"
+                Tag="enlarge" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_ZoomOut}"
+                IsCheckable="True"
+                Tag="narrow" />
         </MenuItem>
         <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_PageDisplay}" Tag="PageDisplay">
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_SinglePage}" Tag="SingleView" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_SinglePageContinuous}" Tag="SingleContinueView" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_TwoPages}" Tag="DoubleView" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_TwoPagesContinuous}" Tag="DoubleContinueView" IsCheckable="True" />
-            <MenuItem Header="{x:Static mainpage:MainPage.ViewRightMenu_BookMode}" Tag="BookMode" IsCheckable="True" />
-        </MenuItem>
-        <MenuItem  Tag="HighlightLinks" Header="高亮显示超链接" IsCheckable="True">
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_SinglePage}"
+                IsCheckable="True"
+                Tag="SingleView" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_SinglePageContinuous}"
+                IsCheckable="True"
+                Tag="SingleContinueView" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_TwoPages}"
+                IsCheckable="True"
+                Tag="DoubleView" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_TwoPagesContinuous}"
+                IsCheckable="True"
+                Tag="DoubleContinueView" />
+            <MenuItem
+                Header="{x:Static mainpage:MainPage.ViewRightMenu_BookMode}"
+                IsCheckable="True"
+                Tag="BookMode" />
         </MenuItem>
+        <MenuItem
+            Header="高亮显示超链接"
+            IsCheckable="True"
+            Tag="HighlightLinks" />
         <Separator
             Height="1"
             BorderBrush="#33000000"

+ 5 - 5
PDF Office/Styles/CustomBtnStyle.xaml

@@ -321,7 +321,7 @@
     <Style x:Key="InsideBarBtnStyle" TargetType="{x:Type Button}">
         <Setter Property="Background" Value="Transparent" />
         <Setter Property="BorderBrush" Value="Transparent" />
-        <Setter Property="Margin" Value="4,0,4,0"></Setter>
+        <Setter Property="Margin" Value="4,0,4,0" />
         <Setter Property="Width" Value="auto" />
         <Setter Property="Height" Value="28" />
         <Setter Property="Template">
@@ -331,8 +331,8 @@
                         x:Name="border"
                         Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
-                        CornerRadius="4"
                         BorderThickness="0,0,0,0"
+                        CornerRadius="4"
                         SnapsToDevicePixels="true">
                         <ContentPresenter
                             x:Name="contentPresenter"
@@ -345,15 +345,15 @@
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">
-                            <Setter TargetName="border" Property="Background"  Value="{StaticResource color.item-state.sel.bg.lv2}" />
+                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                         </Trigger>
                         <Trigger Property="IsPressed" Value="true">
-                            <Setter TargetName="border" Property="Background"  Value="{StaticResource color.item-state.sel.bg.lv2}" />
+                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                         </Trigger>
                         <Trigger Property="IsEnabled" Value="false">
-                            <Setter TargetName="border" Property="Background"  Value="{StaticResource color.item-state.sel.bg.lv2}" />
+                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                         </Trigger>
                     </ControlTemplate.Triggers>

+ 44 - 44
PDF Office/Styles/RadioButtonStyle.xaml

@@ -267,7 +267,7 @@
         <Setter Property="Background" Value="Transparent" />
         <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
         <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
-        <Setter Property="Padding" Value="0"/>
+        <Setter Property="Padding" Value="0" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type RadioButton}">
@@ -430,7 +430,7 @@
         </Setter>
     </Style>
 
-    <!--右键菜单,单选按钮-->
+    <!--  右键菜单,单选按钮  -->
     <Style x:Key="MenuRadioBtnStyle" TargetType="{x:Type RadioButton}">
         <Setter Property="BorderThickness" Value="1" />
         <Setter Property="Background" Value="Transparent" />
@@ -444,34 +444,34 @@
                         SnapsToDevicePixels="True">
                         <Grid>
                             <Grid.ColumnDefinitions>
-                                <ColumnDefinition Width="20"/>
+                                <ColumnDefinition Width="20" />
                                 <ColumnDefinition />
                             </Grid.ColumnDefinitions>
 
-                            <Path x:Name="pathIcon" Visibility="Collapsed" Data="M11.1144 1.57308L5.71438 9.28737C5.58464 9.47271 5.37817 9.58958 5.15248 9.60543C4.9268 9.62128 4.70603 9.5344 4.55166 9.36901L0.95166 5.51187L2.04824 4.48839L5.01649 7.66866L9.88553 0.712891L11.1144 1.57308Z"
-                                  Fill="{StaticResource color.icon.base.neutral.norm.lv1}" 
-                                  />
+                            <Path
+                                x:Name="pathIcon"
+                                Data="M11.1144 1.57308L5.71438 9.28737C5.58464 9.47271 5.37817 9.58958 5.15248 9.60543C4.9268 9.62128 4.70603 9.5344 4.55166 9.36901L0.95166 5.51187L2.04824 4.48839L5.01649 7.66866L9.88553 0.712891L11.1144 1.57308Z"
+                                Fill="{StaticResource color.icon.base.neutral.norm.lv1}"
+                                Visibility="Collapsed" />
 
                             <ContentPresenter
-                            x:Name="contentPresenter"
-                            Grid.Column="1"
-                            Margin="{TemplateBinding Padding}"
-                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
-                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
-                            Focusable="False"
-                            RecognizesAccessKey="True"
-                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                                x:Name="contentPresenter"
+                                Grid.Column="1"
+                                Margin="{TemplateBinding Padding}"
+                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                Focusable="False"
+                                RecognizesAccessKey="True"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                         </Grid>
-                        
+
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="HasContent" Value="true">
                             <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
                             <Setter Property="Padding" Value="4,-1,0,0" />
                         </Trigger>
-                        <Trigger Property="IsMouseOver" Value="true">
-                         
-                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true" />
                         <Trigger Property="IsEnabled" Value="false">
                             <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
                         </Trigger>
@@ -695,46 +695,46 @@
         <Setter Property="Padding" Value="8,0,0,0" />
         <Setter Property="FontSize" Value="14" />
         <Setter Property="FontFamily" Value="Segoe UI" />
-            <Setter Property="VerticalAlignment" Value="Center" />
+        <Setter Property="VerticalAlignment" Value="Center" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type RadioButton}">
                     <Grid
-                                x:Name="templateRoot"
-                                Background="Transparent"
-                                SnapsToDevicePixels="True">
+                        x:Name="templateRoot"
+                        Background="Transparent"
+                        SnapsToDevicePixels="True">
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="Auto" />
                             <ColumnDefinition Width="*" />
                         </Grid.ColumnDefinitions>
                         <Border
-                                    x:Name="radioButtonBorder"
-                                    Width="14"
-                                    Height="14"
-                                    HorizontalAlignment="Center"
-                                    VerticalAlignment="Center"
-                                    Background="{TemplateBinding Background}"
-                                    BorderBrush="{TemplateBinding BorderBrush}"
-                                    BorderThickness="{TemplateBinding BorderThickness}"
-                                    CornerRadius="100">
+                            x:Name="radioButtonBorder"
+                            Width="14"
+                            Height="14"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            CornerRadius="100">
                             <Grid x:Name="markGrid" Margin="1.8">
                                 <Ellipse
-                                            x:Name="optionMark"
-                                            MinWidth="6"
-                                            MinHeight="6"
-                                            Fill="{StaticResource color.icon.checkbox-radio.sel.bg}"
-                                            Opacity="0" />
+                                    x:Name="optionMark"
+                                    MinWidth="6"
+                                    MinHeight="6"
+                                    Fill="{StaticResource color.icon.checkbox-radio.sel.bg}"
+                                    Opacity="0" />
                             </Grid>
                         </Border>
                         <ContentPresenter
-                                    x:Name="contentPresenter"
-                                    Grid.Column="1"
-                                    Margin="{TemplateBinding Padding}"
-                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
-                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
-                                    Focusable="False"
-                                    RecognizesAccessKey="True"
-                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            x:Name="contentPresenter"
+                            Grid.Column="1"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                     </Grid>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">

+ 144 - 143
PDF Office/Styles/WindowsStyle.xaml

@@ -1,145 +1,146 @@
-<ResourceDictionary
-    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-    xmlns:prism="http://prismlibrary.com/">
-    <Style x:Key="WindowStyle" TargetType="{x:Type Window}">
-        <Setter Property="WindowChrome.WindowChrome">
-            <Setter.Value>
-                <WindowChrome
-                    CaptionHeight="32"
-                    CornerRadius="0"
-                    GlassFrameThickness="0"
-                    ResizeBorderThickness="5"
-                    UseAeroCaptionButtons="False" />
-                <!--  GlassFrameThickness="-1" win11上显示异常  -->
-            </Setter.Value>
-        </Setter>
-        <Setter Property="Template">
-            <Setter.Value>
-                <ControlTemplate TargetType="{x:Type Window}">
-                    <Border
-                        Background="{TemplateBinding Background}"
-                        BorderBrush="{TemplateBinding BorderBrush}"
-                        BorderThickness="{TemplateBinding BorderThickness}">
-                        <AdornerDecorator>
-                            <ContentPresenter x:Name="win_content" />
-                        </AdornerDecorator>
-                    </Border>
-                    <ControlTemplate.Triggers>
-                        <Trigger Property="WindowState" Value="Maximized">
-                            <!--  调整边框  -->
-                            <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
-                        </Trigger>
-                    </ControlTemplate.Triggers>
-                </ControlTemplate>
-            </Setter.Value>
-        </Setter>
-    </Style>
-
-    <Style x:Key="WindowWithCorderStyle" TargetType="{x:Type Window}">
-        <Setter Property="WindowChrome.WindowChrome">
-            <Setter.Value>
-                <WindowChrome
-                    CaptionHeight="48"
-                    CornerRadius="15"
-                    GlassFrameThickness="-1"
-                    ResizeBorderThickness="5"
-                    UseAeroCaptionButtons="False" />
-            </Setter.Value>
-        </Setter>
-        <Setter Property="Template">
-            <Setter.Value>
-                <ControlTemplate TargetType="{x:Type Window}">
-                    <Border
-                        Margin="20"
-                        Background="{TemplateBinding Background}"
-                        BorderBrush="{TemplateBinding BorderBrush}"
-                        BorderThickness="{TemplateBinding BorderThickness}"
-                        CornerRadius="8"
-                        Effect="{StaticResource shadow.black-2-2}">
-                        <Grid>
-                            <!--  esc关闭窗体按钮  -->
-                            <Button
-                                HorizontalAlignment="Center"
-                                VerticalAlignment="Center"
-                                Background="Transparent"
-                                IsCancel="True" />
-                            <AdornerDecorator>
-                                <ContentPresenter x:Name="win_content" />
-                            </AdornerDecorator>
-                        </Grid>
-                    </Border>
-                    <ControlTemplate.Triggers>
-                        <Trigger Property="WindowState" Value="Maximized">
-                            <!--  调整边框  -->
-                            <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
-                        </Trigger>
-                    </ControlTemplate.Triggers>
-                </ControlTemplate>
-            </Setter.Value>
-        </Setter>
-    </Style>
-
-    <!--  弹窗的窗体样式  -->
-    <Style
-        x:Key="DialogWindowStyle"
-        BasedOn="{StaticResource WindowWithCorderStyle}"
-        TargetType="{x:Type Window}">
-        <Setter Property="WindowStyle" Value="None" />
-        <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
-        <Setter Property="SizeToContent" Value="WidthAndHeight" />
-        <Setter Property="ShowInTaskbar" Value="False" />
-        <Setter Property="ResizeMode" Value="NoResize" />
-        <Setter Property="Padding" Value="0" />
-        <Setter Property="BorderThickness" Value="1" />
-        <Setter Property="BorderBrush">
-            <Setter.Value>
-                <SolidColorBrush Opacity="0.3" Color="Gray" />
-            </Setter.Value>
-        </Setter>
-        <Setter Property="Background" Value="Transparent" />
-    </Style>
-
-    <Style
-        x:Key="Caption16DialogWindowStyle"
-        BasedOn="{StaticResource DialogWindowStyle}"
-        TargetType="{x:Type Window}">
-        <Setter Property="WindowChrome.WindowChrome">
-            <Setter.Value>
-                <WindowChrome
-                    CaptionHeight="16"
-                    CornerRadius="15"
-                    GlassFrameThickness="-1"
-                    ResizeBorderThickness="5"
-                    UseAeroCaptionButtons="False" />
-            </Setter.Value>
-        </Setter>
-    </Style>
-
-    <Style
-        x:Key="InfoDialogWindowStyle"
-        BasedOn="{StaticResource WindowWithCorderStyle}"
-        TargetType="{x:Type Window}">
-        <Setter Property="WindowStyle" Value="ThreeDBorderWindow" />
-        <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
-        <Setter Property="SizeToContent" Value="WidthAndHeight" />
-        <Setter Property="ShowInTaskbar" Value="True" />
-        <Setter Property="ResizeMode" Value="NoResize" />
-        <Setter Property="Padding" Value="0" />
-        <Setter Property="BorderThickness" Value="1" />
-        <Setter Property="BorderBrush">
-            <Setter.Value>
-                <SolidColorBrush Opacity="0.3" Color="Gray" />
-            </Setter.Value>
-        </Setter>
-        <Setter Property="Background" Value="Transparent" />
-    </Style>
-
-
-    <Style x:Key="stlWindowEx" 
-        BasedOn="{StaticResource DialogWindowStyle}"
-        TargetType="{x:Type Window}">
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:prism="http://prismlibrary.com/">
+    <Style x:Key="WindowStyle" TargetType="{x:Type Window}">
+        <Setter Property="WindowChrome.WindowChrome">
+            <Setter.Value>
+                <WindowChrome
+                    CaptionHeight="32"
+                    CornerRadius="0"
+                    GlassFrameThickness="0"
+                    ResizeBorderThickness="5"
+                    UseAeroCaptionButtons="False" />
+                <!--  GlassFrameThickness="-1" win11上显示异常  -->
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Window}">
+                    <Border
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}">
+                        <AdornerDecorator>
+                            <ContentPresenter x:Name="win_content" />
+                        </AdornerDecorator>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="WindowState" Value="Maximized">
+                            <!--  调整边框  -->
+                            <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <Style x:Key="WindowWithCorderStyle" TargetType="{x:Type Window}">
+        <Setter Property="WindowChrome.WindowChrome">
+            <Setter.Value>
+                <WindowChrome
+                    CaptionHeight="48"
+                    CornerRadius="15"
+                    GlassFrameThickness="-1"
+                    ResizeBorderThickness="5"
+                    UseAeroCaptionButtons="False" />
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Window}">
+                    <Border
+                        Margin="20"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        CornerRadius="8"
+                        Effect="{StaticResource shadow.black-2-2}">
+                        <Grid>
+                            <!--  esc关闭窗体按钮  -->
+                            <Button
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Background="Transparent"
+                                IsCancel="True" />
+                            <AdornerDecorator>
+                                <ContentPresenter x:Name="win_content" />
+                            </AdornerDecorator>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="WindowState" Value="Maximized">
+                            <!--  调整边框  -->
+                            <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <!--  弹窗的窗体样式  -->
+    <Style
+        x:Key="DialogWindowStyle"
+        BasedOn="{StaticResource WindowWithCorderStyle}"
+        TargetType="{x:Type Window}">
+        <Setter Property="WindowStyle" Value="None" />
+        <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
+        <Setter Property="SizeToContent" Value="WidthAndHeight" />
+        <Setter Property="ShowInTaskbar" Value="False" />
+        <Setter Property="ResizeMode" Value="NoResize" />
+        <Setter Property="Padding" Value="0" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="BorderBrush">
+            <Setter.Value>
+                <SolidColorBrush Opacity="0.3" Color="Gray" />
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Background" Value="Transparent" />
+    </Style>
+
+    <Style
+        x:Key="Caption16DialogWindowStyle"
+        BasedOn="{StaticResource DialogWindowStyle}"
+        TargetType="{x:Type Window}">
+        <Setter Property="WindowChrome.WindowChrome">
+            <Setter.Value>
+                <WindowChrome
+                    CaptionHeight="16"
+                    CornerRadius="15"
+                    GlassFrameThickness="-1"
+                    ResizeBorderThickness="5"
+                    UseAeroCaptionButtons="False" />
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <Style
+        x:Key="InfoDialogWindowStyle"
+        BasedOn="{StaticResource WindowWithCorderStyle}"
+        TargetType="{x:Type Window}">
+        <Setter Property="WindowStyle" Value="ThreeDBorderWindow" />
+        <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
+        <Setter Property="SizeToContent" Value="WidthAndHeight" />
+        <Setter Property="ShowInTaskbar" Value="True" />
+        <Setter Property="ResizeMode" Value="NoResize" />
+        <Setter Property="Padding" Value="0" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="BorderBrush">
+            <Setter.Value>
+                <SolidColorBrush Opacity="0.3" Color="Gray" />
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Background" Value="Transparent" />
+    </Style>
+
+
+    <Style
+        x:Key="stlWindowEx"
+        BasedOn="{StaticResource DialogWindowStyle}"
+        TargetType="{x:Type Window}">
         <Setter Property="ResizeMode" Value="CanResize" />
-    </Style>
-
+    </Style>
+
 </ResourceDictionary>

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -717,7 +717,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 var isHas = views.FindFirst(q => q is Views.TipContent.LinkAnnotTip);
                 if (isHas != null)
                 {
-
+                    isExist=true;
                 }
                 //foreach (var item in views)
                 //{

+ 23 - 5
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePopupViewModel.cs

@@ -1,4 +1,5 @@
-using ComPDFKitViewer.PdfViewer;
+using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Model;
 using PDF_Office.Properties;
 using Prism.Commands;
@@ -48,15 +49,29 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private ViewContentViewModel ViewContentViewModel;
-        public DelegateCommand ContentTextLostFocus { get; set; }
+        private StickyAnnotArgs StickyAnnotArgs;
+        private AnnotCommandArgs AnnotCommandArgs;
+        private CPDFViewer PDFViewer;
+        public DelegateCommand<object> ContentTextLostFocus { get; set; }
 
         public StickyNotePopupViewModel()
         {
-            ContentTextLostFocus = new DelegateCommand(ContentText_LostFocus);
+            ContentTextLostFocus = new DelegateCommand<object>(ContentText_LostFocus);
         }
 
-        private void ContentText_LostFocus()
+        private void ContentText_LostFocus(object obj)
         {
+            if (ViewContentViewModel == null || StickyAnnotArgs == null || PDFViewer == null || AnnotCommandArgs == null)
+            {
+                return;
+            }
+            if (string.IsNullOrEmpty(ContentText))
+            {
+                ViewContentViewModel.IsNoteAdd = false;
+                return;
+            }
+            StickyAnnotArgs.StickyNote = ContentText;
+            PDFViewer.CreatePageAnnot(AnnotCommandArgs.PageIndex, StickyAnnotArgs);
             ViewContentViewModel.IsNoteAdd = false;
         }
 
@@ -72,8 +87,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out ViewContentViewModel);
+            navigationContext.Parameters.TryGetValue<StickyAnnotArgs>(ParameterNames.StickyAnnotArgs, out StickyAnnotArgs);
+            navigationContext.Parameters.TryGetValue<AnnotCommandArgs>(ParameterNames.AnnotCommandArgs, out AnnotCommandArgs);
+            navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             AuthorText = Settings.Default.AppProperties.Description.Author;
-            DateText = DateTime.Now.ToString(@"yyyyMMddHHmmsszzz\'").Replace(':', '\'') + "\n";
+            DateText = DateTime.Now.ToString("MM/dd/yyyy  hh:mm:ss");
         }
     }
 }

+ 30 - 16
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -1009,9 +1009,9 @@ namespace PDF_Office.ViewModels.Tools
                     //是否展开右侧面板 =>否(链接、图章、签名除外)
                     ShowPropertyPanel(false);
                     if (str == AddAnnotType.AnnotLink.ToString()
-                        || str == AddAnnotType.AnnotStamp.ToString()
-                        || str == AddAnnotType.AnnotAutograph.ToString()
-                        )
+                    || str == AddAnnotType.AnnotStamp.ToString()
+                    || str == AddAnnotType.AnnotAutograph.ToString()
+                    )
                     {
                         ShowPropertyPanel(true);
                     }
@@ -1081,18 +1081,32 @@ namespace PDF_Office.ViewModels.Tools
                         //stickyAnnotArgs.ClientRect = annotCommand.TextRect;
                         List<TextSelectNode> textSelectNodes = PDFViewer.GetSelectTextInfo();
 
-                        stickyAnnotArgs.ClientRect = new Rect(textSelectNodes[0].StartPoint.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
-                        stickyAnnotArgs.StickyNote = annotCommand.Text;
+                        //stickyAnnotArgs.ClientRect = new Rect(textSelectNodes[0].StartPoint.X, annotCommand.TextRect.Y - annotCommand.TextRect.Height, annotCommand.TextRect.Width, annotCommand.TextRect.Height);
+                        Rect rect = annotCommand.TextRectList[0];
+                        stickyAnnotArgs.ClientRect = new Rect(rect.X, rect.Y - rect.Height, rect.Width, rect.Height);
+                        //stickyAnnotArgs.StickyNote = annotCommand.Text;
                         //PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
 
                         NavigationParameters param = new NavigationParameters();
                         param.Add(ParameterNames.PDFViewer, PDFViewer);
                         param.Add(ParameterNames.StickyAnnotArgs, stickyAnnotArgs);
                         param.Add(ParameterNames.ViewContentViewModel, viewContentViewModel);
+                        param.Add(ParameterNames.AnnotCommandArgs, annotCommand);
 
+                        ContentControl window = null;
+                        if (PDFViewer.Parent as ContentControl != null)
+                            window = PDFViewer.Parent as ContentControl;
+                        else
+                            window = App.Current.MainWindow;
+                        var point = Mouse.GetPosition(window);
                         viewContentViewModel.NotePopupVisible = Visibility.Visible;
-                        viewContentViewModel.CanvasNoteLeft = annotCommand.TextRect.X;
-                        viewContentViewModel.CanvasNoteTop = annotCommand.TextRect.Y;
+                        viewContentViewModel.CanvasNoteLeft = point.X;
+                        viewContentViewModel.CanvasNoteBottom = point.Y;
+                        if (point.Y > window.ActualHeight / 2 )
+                        {
+                            viewContentViewModel.CanvasNoteBottom = point.Y-window.ActualHeight/2;
+                        }
+
                         viewContentViewModel.IsNoteAdd = true;
                         region.RequestNavigate(viewContentViewModel.NotePopupRegionName, "StickyNotePopup", param);
                         //customStickyPopup.SetAuthor(Settings.Default.AppProperties.Description.Author);
@@ -1608,15 +1622,15 @@ namespace PDF_Office.ViewModels.Tools
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.Annotation, args);
                     dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
-                    {
-                        if (e.Result == ButtonResult.OK && e.Parameters != null)
-                        {
-                            PDFViewer.UndoManager.CanSave = true;
-                            if (e.Parameters.ContainsKey(ParameterNames.Annotation) && e.Parameters.ContainsKey(ParameterNames.AnnotEvent))
-                            {
-                            }
-                        }
-                    });
+                                          {
+                                              if (e.Result == ButtonResult.OK && e.Parameters != null)
+                                              {
+                                                  PDFViewer.UndoManager.CanSave = true;
+                                                  if (e.Parameters.ContainsKey(ParameterNames.Annotation) && e.Parameters.ContainsKey(ParameterNames.AnnotEvent))
+                                                  {
+                                                  }
+                                              }
+                                          });
                 }
             }
         }

+ 18 - 4
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -31,6 +31,7 @@ using System.Text;
 using PDF_Office.Views.Tools;
 using System.Windows.Input;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
+using ImTools;
 
 namespace PDF_Office.ViewModels
 {
@@ -296,14 +297,14 @@ namespace PDF_Office.ViewModels
             }
         }
 
-        private double canvasNoteTop;
+        private double canvasNoteBottom;
 
-        public double CanvasNoteTop
+        public double CanvasNoteBottom
         {
-            get { return canvasNoteTop; }
+            get { return canvasNoteBottom; }
             set
             {
-                SetProperty(ref canvasNoteTop, value);
+                SetProperty(ref canvasNoteBottom, value);
             }
         }
 
@@ -796,6 +797,19 @@ namespace PDF_Office.ViewModels
             if (NotePopupVisible == Visibility.Visible && IsNoteAdd == false)
             {
                 NotePopupVisible = Visibility.Collapsed;
+                if (region.Regions.ContainsRegionWithName(NotePopupRegionName))
+                {
+                    var views = region.Regions[NotePopupRegionName].Views;
+                    foreach (var item in views)
+                    {
+                        if (item is StickyNotePopup sticky)
+                        {
+                            var contentRegion = region.Regions[NotePopupRegionName];
+                            contentRegion.Remove(sticky);
+                            break;
+                        }
+                    }
+                }
             }
         }
 

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

@@ -94,7 +94,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
                     return;
                 }
             }
-            (DataContext as StickyNotePopupViewModel).ContentTextLostFocus.Execute();
+            (DataContext as StickyNotePopupViewModel).ContentTextLostFocus.Execute(sender);
             CloseText_MouseUp(this, null);
         }
 

+ 8 - 6
PDF Office/Views/ViewContent.xaml

@@ -483,12 +483,14 @@
                 prism:RegionManager.RegionName="{Binding LeftTipContentRegionName}"
                 Visibility="{Binding LeftTipVisible}" />
             <!--  便签弹窗  -->
-            <Canvas x:Name="CanvasNote" Grid.Column="2">
-                <ContentControl
-                    Canvas.Left="{Binding CanvasNoteLeft}"
-                    Canvas.Bottom="{Binding CanvasNoteTop}"
-                    prism:RegionManager.RegionName="{Binding NotePopupRegionName}"
-                    Visibility="{Binding NotePopupVisible}" />
+            <Canvas
+                x:Name="CanvasNote"
+                Grid.Column="2"
+                Visibility="{Binding NotePopupVisible}">
+                <StackPanel Canvas.Left="{Binding CanvasNoteLeft}" Canvas.Bottom="{Binding CanvasNoteBottom}">
+                    <!--<TextBlock Text="000" />-->
+                    <ContentControl prism:RegionManager.RegionName="{Binding NotePopupRegionName}" />
+                </StackPanel>
             </Canvas>
         </Grid>