Browse Source

注释 - 注释通用属性规范代码

chenrongqian@kdanmobile.com 2 years ago
parent
commit
9b1668c295

+ 0 - 1
PDF Office/App.xaml.cs

@@ -279,7 +279,6 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<WatermarkCreateFileContent>();
             containerRegistry.RegisterForNavigation<WatermarkDocumentContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
-            containerRegistry.RegisterForNavigation<MultiSelectAnnotProperty>();
             containerRegistry.RegisterForNavigation<FreehandAnnotProperty>();
             containerRegistry.RegisterForNavigation<FreetextAnnotProperty>();
             containerRegistry.RegisterForNavigation<StickyNoteProperty>();

+ 6 - 6
PDF Office/ViewModels/PropertyPanel/AnnotPanel/AnnotBasePropertyVM.cs

@@ -8,10 +8,10 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Media;
 
-namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
+namespace PDF_Office.Model.AnnotPanel
 {
     //注释的通用属性
-    public class AnnotBasePropertyVM : BindableBase
+    public class AnnotCommon : BindableBase
     {
         //注释类型
         private AnnotArgsType _annotType;
@@ -120,7 +120,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             get { return _fontColor; }
             set { SetProperty(ref _fontColor, value); CurrentFontColor = _fontColor; }
-            
+
         }
 
         //当前边框颜色
@@ -152,7 +152,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         //多选注释:用处 - 多选注释使得下拉框为空内容,刷新最新的UI布局
         private bool _isMultiSelected = false;
-        public bool IsMultiSelected{
+        public bool IsMultiSelected
+        {
             get { return _isMultiSelected; }
             set => SetProperty(ref _isMultiSelected, value);
         }
@@ -166,7 +167,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         //Todo:由于考虑到有些UI在VM不太方便处理,因此需要触发该函数到外部xaml.cs里更改UI属性。
         //更改多个属性:value可为键值对集合
         //适应范围:若VM在Loaded进行绑定,需要UI初始化之后,才能起到作用
-        public void InvokeToUI(object sender,object value)
+        public void InvokeToUI(object sender, object value)
         {
             SelectedAnnotInvokeToUI?.Invoke(sender, value);
         }
@@ -241,5 +242,4 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         }
 
     }
-
 }

+ 1 - 9
PDF Office/PDF Office.csproj

@@ -336,6 +336,7 @@
     <Compile Include="Helper\SettingHelper.cs" />
     <Compile Include="Helper\ToolMethod.cs" />
     <Compile Include="Helper\UpdateAttributeHelper.cs" />
+    <Compile Include="Model\AnnotPanel\AnnotCommon.cs" />
     <Compile Include="Model\AnnotPanel\Signature.cs" />
     <Compile Include="Model\BOTA\AnnotationHandlerEventArgs.cs" />
     <Compile Include="Model\AnnotPanel\Stamp.cs" />
@@ -508,8 +509,6 @@
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListTextContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\AnnotBasePropertyVM.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\MultiSelectAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureCreateDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SnapshotEditMenuViewModel.cs" />
@@ -1050,9 +1049,6 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\LinkAnnotProperty.xaml.cs">
       <DependentUpon>LinkAnnotProperty.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\MultiSelectAnnotProperty.xaml.cs">
-      <DependentUpon>MultiSelectAnnotProperty.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml.cs">
       <DependentUpon>SharpsAnnotProperty.xaml</DependentUpon>
     </Compile>
@@ -1828,10 +1824,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\MultiSelectAnnotProperty.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

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

@@ -3,6 +3,7 @@ using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using PDFSettings;
@@ -46,8 +47,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public List<ComboDataItem> PenSizeItems { get; protected set; }
         public List<ComboDataItem> EraserSizeItems { get; protected set; }
 
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);

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

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using PDFSettings;
@@ -28,8 +29,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set { SetProperty(ref _fontVm, value); }
         }
 
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);

+ 0 - 41
PDF Office/ViewModels/PropertyPanel/AnnotPanel/MultiSelectAnnotPropertyViewModel.cs

@@ -1,41 +0,0 @@
-using PDF_Office.Model;
-using PDF_Office.ViewModels.Tools;
-using Prism.Mvvm;
-using Prism.Regions;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
-{
-    public class MultiSelectAnnotPropertyViewModel : BindableBase, INavigationAware
-    {
-        private AnnotPropertyPanel PropertyPanel;
-        public MultiSelectAnnotPropertyViewModel()
-        {
-
-        }
-
-        public bool IsNavigationTarget(NavigationContext navigationContext)
-        {
-            return true;
-        }
-
-        public void OnNavigatedFrom(NavigationContext navigationContext)
-        {
-
-        }
-
-
-
-        public void OnNavigatedTo(NavigationContext navigationContext)
-        {
-
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
-          
-
-        }
-    }
-}

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

@@ -3,6 +3,7 @@ using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -50,8 +51,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
     public class SharpsAnnotPropertyViewModel : BindableBase, INavigationAware
     {
         #region 属性
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);

+ 1 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using Prism.Commands;
 using Prism.Mvvm;

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

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Properties;
 using PDF_Office.ViewModels.Tools;
 using Prism.Commands;
@@ -64,8 +65,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
     {
 
         #region 属性
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);

+ 0 - 15
PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml

@@ -1,15 +0,0 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.MultiSelectAnnotProperty"
-             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:prism="http://prismlibrary.com/"
-             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-        <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
-    </Grid>
-</UserControl>

+ 0 - 28
PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml.cs

@@ -1,28 +0,0 @@
-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 PDF_Office.Views.PropertyPanel.AnnotPanel
-{
-    /// <summary>
-    /// MultiSelectAnnotProperty.xaml 的交互逻辑
-    /// </summary>
-    public partial class MultiSelectAnnotProperty : UserControl
-    {
-        public MultiSelectAnnotProperty()
-        {
-            InitializeComponent();
-        }
-    }
-}