Kaynağa Gözat

优化 - 笔记弹窗口标题栏有效区域,手绘虚实线

chenrongqian@kdanmobile.com 2 yıl önce
ebeveyn
işleme
febac26802

+ 17 - 0
PDF Office/Styles/WindowsStyle.xaml

@@ -99,6 +99,23 @@
         </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}"

+ 2 - 3
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -151,13 +151,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     case "Dashed":
                         newDash.Dashes.Add(2);
                         newDash.Dashes.Add(2);
-                     //   AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Dash);
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, newDash);
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.LineStyle, newDash);
                         
                         break;
 
                     case "Solid":
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
                         break;
 
                 }

+ 17 - 5
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -126,6 +126,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void SetAnnotType()
         {
+            if(BasicVm.IsMultiSelected)
+            {
+                BasicVm.AnnotTypeTitle = "General Properties";
+                return;
+            }
+
             switch (BasicVm.AnnotType)
             {
                 case AnnotArgsType.AnnotHighlight:
@@ -159,14 +165,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             if(PropertyPanel != null)
             {
-                AnnotEvent = PropertyPanel.AnnotEvent;
-                Annot = PropertyPanel.annot;
-                BasicVm.AnnotType = Annot.EventType;
-                BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected;
+                AllVariable();
                 SetAnnotType();
 
                 //多选注释,默认通用属性颜色为高亮注释的预设颜色
-                if(BasicVm.IsMultiSelected)
+                if (BasicVm.IsMultiSelected)
                 {
                     var annotate = Settings.Default.AppProperties.Annotate;
                     if (annotate != null)
@@ -186,6 +189,15 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         }
 
+        //全局变量,优先集中处理
+        private void AllVariable()
+        {
+            AnnotEvent = PropertyPanel.AnnotEvent;
+            Annot = PropertyPanel.annot;
+            BasicVm.AnnotType = Annot.EventType;
+            BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected;
+        }
+
         private void GetAnnotProperty()
         {
             if (Annot != null)

+ 18 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -1079,8 +1079,25 @@ namespace PDF_Office.ViewModels.Tools
                 var annot = menu.Parameter as AnnotHandlerEventArgs;
                 if (annot != null)
                 {
+                    AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
+
+                    args.ClientRect = annot.ClientRect;
+                    args.AnnotHandlerEventArgs = annot;
+                    args.PageIndex = annot.PageIndex;
+                    args.AnnotIndex = annot.AnnotIndex;
+                    args.EventType = annot.EventType;
+                    args.CreateTime = annot.CreateTime;
+                    args.UpdateTime = annot.UpdateTime;
+                    args.Content = annot.Content;
+                    args.MarkupContent = annot.MarkupContent;
+                    args.Author = annot.Author;
+                    args.Locked = annot.Locked;
+                    args.ReadOnly = annot.ReadOnly;
+                    args.FormField = annot.FormField;
+                    args.Document = PDFViewer.Document;
+
                     DialogParameters value = new DialogParameters();
-                    value.Add(ParameterNames.Annotation, annot);
+                    value.Add(ParameterNames.Annotation, args);
                     dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
                     {
                         if (e.Result == ButtonResult.OK && e.Parameters != null)

+ 3 - 2
PDF Office/Views/Dialog/BOTA/AddAnnotationDialog.xaml

@@ -14,16 +14,17 @@
     Width="320"
     MinHeight="144"
     d:DataContext="{d:DesignInstance Type=dialogBOTA:AddAnnotationDialogViewModel}"
-    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:Dialog.WindowStyle="{StaticResource Caption16DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     Background="{StaticResource color.sys.layout.anti}"
     mc:Ignorable="d">
     <UserControl.Resources>
         <SolidColorBrush x:Key="path.fill" Color="#273C62" />
         <convert:ObjectConvert x:Key="ObjectConvert" />
+     
     </UserControl.Resources>
-    <StackPanel Background="Transparent">
 
+    <StackPanel >
         <TextBox
             Name="TxtInput"
             Width="288"

+ 1 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

@@ -73,6 +73,7 @@
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
+                <TextBlock Text="Color" HorizontalAlignment="Left"/>
                 <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"
                                                UIColor="{Binding BasicVm.CurrentFontColor,Mode=OneWay}" >
                     <i:Interaction.Triggers>