liuaoran 2 vuotta sitten
vanhempi
commit
f09509ddb3
21 muutettua tiedostoa jossa 485 lisäystä ja 42 poistoa
  1. 6 8
      PDF Office/CustomControl/CommonWritableComboBox.xaml
  2. 1 1
      PDF Office/CustomControl/NumericUpDown.xaml
  3. 1 1
      PDF Office/CustomControl/NumericUpDown.xaml.cs
  4. 113 0
      PDF Office/Model/EditTools/Watermark/WatermarkCreateModel.cs
  5. 13 0
      PDF Office/Model/EditTools/Watermark/WatermarkTemplateListModel.cs
  6. 2 0
      PDF Office/PDF Office.csproj
  7. 3 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs
  8. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  9. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  10. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  11. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  12. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  13. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  14. 1 0
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  15. 1 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs
  16. 3 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs
  17. 139 6
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs
  18. 172 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  19. 2 2
      PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml
  20. 10 10
      PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml
  21. 12 12
      PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

+ 6 - 8
PDF Office/CustomControl/CommonWritableComboBox.xaml

@@ -12,7 +12,7 @@
             <ColumnDefinition Width="*"></ColumnDefinition>
             <ColumnDefinition Width="16"></ColumnDefinition>
         </Grid.ColumnDefinitions>
-        <TextBox Name="TextBox_Num"
+            <TextBox Name="TextBox_Num"
                 MinHeight="28"
                 Grid.Column="0"
                 Padding="16,0,0,0"
@@ -24,18 +24,16 @@
                 Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=Foreground}"
                 InputMethod.IsInputMethodEnabled="False"
                 PreviewTextInput="CountTextBox_PreviewTextInput"
-                Text="1"
+                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=Text}"
                 TextAlignment="Left"
                 KeyDown="CurrentPage_KeyDown"
-<<<<<<< Updated upstream
                 TextChanged="TextBox_Num_TextChanged"
-                 Panel.ZIndex="1"/>
+                 Panel.ZIndex="1">
+         
+            </TextBox>
         <ComboBox Name="ComboBox_Type" MinHeight="28" MinWidth="64" HorizontalAlignment="Right" BorderThickness="00" Background="#F3F3F3" Grid.Column="0" Grid.ColumnSpan="2" SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=TypeSouce}" Panel.ZIndex="0">
         </ComboBox>
-=======
-                TextChanged="TextBox_Num_TextChanged" />
-        <ComboBox Name="ComboBox_Type" MinHeight="32" Width="16" HorizontalAlignment="Right" BorderBrush="Transparent" BorderThickness="00" Grid.Column="1" SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=TypeSouce}"></ComboBox>
->>>>>>> Stashed changes
+
     </Grid>
     </Border>
 </UserControl>

+ 1 - 1
PDF Office/CustomControl/NumericUpDown.xaml

@@ -29,7 +29,7 @@
                 Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
                 InputMethod.IsInputMethodEnabled="False"
                 PreviewTextInput="CountTextBox_PreviewTextInput"
-                Text="1"
+                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
                 TextAlignment="Left"
                 TextChanged="TextBox_Num_TextChanged" />
             <Grid Grid.Column="1" Width="20">

+ 1 - 1
PDF Office/CustomControl/NumericUpDown.xaml.cs

@@ -30,7 +30,7 @@ namespace PDF_Office.CustomControl
         }
 
         public static readonly DependencyProperty TextProperty =
-            DependencyProperty.Register("Text", typeof(string), typeof(NumericUpDown), new PropertyMetadata(""));
+            DependencyProperty.Register("Text", typeof(string), typeof(NumericUpDown), new PropertyMetadata("1"));
 
 
         /// <summary>

+ 113 - 0
PDF Office/Model/EditTools/Watermark/WatermarkCreateModel.cs

@@ -0,0 +1,113 @@
+using ComPDFKit.PDFWatermark;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.EditTools.Watermark
+{
+
+    public class WatermarkCreateModel
+    {
+       
+    }
+    public class WatermarkInfo {
+
+        /// <summary>
+        /// 水印类型;
+        /// </summary>
+        public C_Watermark_Type WatermarkType { get; set; } = C_Watermark_Type.WATERMARK_TYPE_TEXT;
+
+        /// <summary>
+        /// 文本水印内容;
+        /// </summary>
+        public string Text { get; set; } = "";
+
+        /// <summary>
+        /// 文本水印颜色;
+        /// </summary>
+        public string TextColor { get; set; } = "#FFFFFF";
+
+        /// <summary>
+        /// 文本水印大小;
+        /// </summary>
+        public string TextSize { get; set; } = "5";
+
+        /// <summary>
+        /// 图片水印内容;
+        /// </summary>
+        public byte[] ImageArray { get; set; } = null;
+
+        /// <summary>
+        /// 图片水印大小;
+        /// </summary>
+        public float ImageSize { get; set; } = 5;
+
+        /// <summary>
+        /// 图片水印宽度;
+        /// </summary>
+        public int ImageWidth { get; set; } = 100;
+
+        /// <summary>
+        /// 图片水印高度;
+        /// </summary>
+        public int ImageHeight { get; set; } = 100;
+
+        /// <summary>
+        /// 水印页面范围;
+        /// </summary>
+        public string PageRange { get; set; } = "1";
+
+        /// <summary>
+        /// 水印垂直位置;
+        /// </summary>
+        public C_Watermark_Vertalign WatermarkVertalign { get; set; } = C_Watermark_Vertalign.WATERMARK_VERTALIGN_CENTER;
+
+        /// <summary>
+        /// 水印水平位置;
+        /// </summary>
+        public C_Watermark_Horizalign WatermarkHorizalign { get; set; } = C_Watermark_Horizalign.WATERMARK_HORIZALIGN_CENTER;
+
+        /// <summary>
+        /// 水印相对垂直距离;
+        /// </summary>
+        public float VertOffset { get; set; } = 0;
+
+        /// <summary>
+        /// 水印相对水平距离;
+        /// </summary>
+        public float HorizOffset { get; set; } = 0;
+
+        /// <summary>
+        /// 水印石否平铺;
+        /// </summary>
+        public bool Isfull { get; set; } = false;
+
+        /// <summary>
+        /// 水印平铺水平间距;
+        /// </summary>
+        public float HorizontalSpacing { get; set; } = 0;
+
+        /// <summary>
+        /// 水印平铺垂直间距;
+        /// </summary>
+        public float VerticalSpacing { get; set; } = 0;
+
+        /// <summary>
+        /// 水印旋转角度;
+        /// </summary>
+        public float Rotation { get; set; } = 0;
+
+        /// <summary>
+        /// 水印透明度;
+        /// </summary>
+        public byte Opacity { get; set; } = 100;
+
+        /// <summary>
+        /// 水印是否在页面上方;
+        /// </summary>
+        public bool IsFront { get; set; } = false;
+
+    }
+}

+ 13 - 0
PDF Office/Model/EditTools/Watermark/WatermarkTemplateListModel.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.EditTools.Watermark
+{
+    public class WatermarkTemplateListModel
+    {
+
+    }
+}

+ 2 - 0
PDF Office/PDF Office.csproj

@@ -266,6 +266,8 @@
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageSplitDialogModel.cs" />
     <Compile Include="Model\EditTools\Background\BackgroundCreateModel.cs" />
     <Compile Include="Model\EditTools\Background\BackgroundTemplateListModel.cs" />
+    <Compile Include="Model\EditTools\Watermark\WatermarkCreateModel.cs" />
+    <Compile Include="Model\EditTools\Watermark\WatermarkTemplateListModel.cs" />
     <Compile Include="Model\PageEdit\ExtractModel.cs" />
     <Compile Include="Model\PageEdit\PageEditItem.cs" />
     <Compile Include="Model\ParameterNames.cs" />

+ 3 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs

@@ -86,6 +86,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;
@@ -98,6 +99,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;
@@ -156,6 +158,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             char[] rangeSeparator = new char[] { '-' };
             if (!CommonHelper.GetPagesInRange(ref ConverterCSVModel.PageIndexLists, ConverterCSVModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
             { //TODO
+
                 Trace.WriteLine("输入不对");
                 MessageBoxEx.Show("输入不对");
                 return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -115,6 +115,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -110,6 +110,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -219,6 +219,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -108,6 +108,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -107,6 +107,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -108,6 +108,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -109,6 +109,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 1 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs

@@ -161,6 +161,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        ExtractPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 3 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs

@@ -90,9 +90,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
         }
 
-        public string AveragePagesText { set; get; } = "";
+        public string AveragePagesText { set; get; } = "1";
 
-        public string AverageFilesText { set; get; } = "";
+        public string AverageFilesText { set; get; } = "1";
 
 
         private string filePathName = "";
@@ -450,6 +450,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
                     { //TODO
+                        SplitPreview.PageIndexLists.Add(0);
                         Trace.WriteLine("输入不对");
                         MessageBoxEx.Show("输入不对");
                         return;

+ 139 - 6
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs

@@ -19,20 +19,153 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             }
         }
 
-        public WatermarkCreateFileContentViewModel()
+        private void InitOpacityList()
         {
+            OpacityList.Clear();
+            for (int temp = 0; temp <= 100; temp += 10)
+            {
+                OpacityList.Add(temp.ToString() + " %");
+            }
+        }
+
+        private List<string> _rotationList = new List<string>();
+        public List<string> RotationList
+        {
+            get { return _rotationList; }
+            set
+            {
+                SetProperty(ref _rotationList, value);
+            }
+        }
 
+        private void InitRotationList()
+        {
+            RotationList.Clear();
+            for (int temp = -45; temp <= 45; temp += 15)
+            {
+                RotationList.Add(temp.ToString());
+            }
         }
 
-        private void InitOpacityList()
+        private List<string> _scaleList = new List<string>();
+        public List<string> ScaleList
         {
-            OpacityList.Clear();
-            for (int temp = 0; temp < 100; temp += 10)
+            get { return _scaleList; }
+            set
             {
-                OpacityList.Add(temp.ToString() + " %");
+                SetProperty(ref _scaleList, value);
+            }
+        }
+
+        private void InitScaleList()
+        {
+            ScaleList.Clear();
+            for (int temp = 0; temp <= 100; temp += 10)
+            {
+                ScaleList.Add(temp.ToString() + " %");
+            }
+        }
+
+        private List<string> _isFrontList = new List<string>();
+        public List<string> IsFrontList
+        {
+            get { return _isFrontList; }
+            set
+            {
+                SetProperty(ref _isFrontList, value);
+            }
+        }
+
+        private void InitIsFrontList()
+        {
+            IsFrontList.Clear();
+            IsFrontList.Add("位于页面上方");
+            IsFrontList.Add("位于页面下方");
+        }
+
+        private int _rotationValue = 0;
+        public int RotationValue
+        {
+            get { return _rotationValue; }
+            set
+            {
+                SetProperty(ref _rotationValue, value);
+            }
+        }
+
+        private int _opacityValue = 100;
+        public int OpacityValue
+        {
+            get { return _opacityValue; }
+            set
+            {
+                SetProperty(ref _opacityValue, value);
+            }
+        }
+
+        private int _relativeScaleValue = 50;
+        public int RelativeScaleValue
+        {
+            get { return _relativeScaleValue; }
+            set
+            {
+                SetProperty(ref _relativeScaleValue, value);
+            }
+        }
+
+        private string _vertOffsetValue = "0";
+        public string VertOffsetValue
+        {
+            get { return _vertOffsetValue; }
+            set
+            {
+                SetProperty(ref _vertOffsetValue, value);
             }
         }
 
+        private string _horizOffsetValue = "0";
+        public string HorizOffsetValue
+        {
+            get { return _horizOffsetValue; }
+            set
+            {
+                SetProperty(ref _horizOffsetValue, value);
+            }
+        }
+
+        private string _verticalSpacingValue = "6";
+        public string VerticalSpacingValue
+        {
+            get { return _verticalSpacingValue; }
+            set
+            {
+                SetProperty(ref _verticalSpacingValue, value);
+            }
+        }
+
+        private string _horizontalSpacingValue = "6";
+        public string HorizontalSpacingValue
+        {
+            get { return _horizontalSpacingValue; }
+            set
+            {
+                SetProperty(ref _horizontalSpacingValue, value);
+            }
+        }
+
+        public WatermarkCreateFileContentViewModel()
+        {
+
+        }
+
+        private void InitList()
+        {
+            InitOpacityList();
+            InitIsFrontList();
+            InitRotationList();
+            InitScaleList();
+        }
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -44,7 +177,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            InitOpacityList();
+            InitList();
         }
     }
 }

+ 172 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -9,10 +9,181 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
 {
     public class WatermarkCreateTextContentViewModel : BindableBase,INavigationAware
     {
+        private List<string> _opacityList = new List<string>();
+        public List<string> OpacityList
+        {
+            get { return _opacityList; }
+            set
+            {
+                SetProperty(ref _opacityList, value);
+            }
+        }
+
+        private void InitOpacityList()
+        {
+            OpacityList.Clear();
+            for (int temp = 0; temp <= 100; temp += 10)
+            {
+                OpacityList.Add(temp.ToString() + " %");
+            }
+        }
+
+        private List<string> _rotationList = new List<string>();
+        public List<string> RotationList
+        {
+            get { return _rotationList; }
+            set
+            {
+                SetProperty(ref _rotationList, value);
+            }
+        }
+
+        private void InitRotationList()
+        {
+            RotationList.Clear();
+            for (int temp = -45; temp <= 45; temp += 15)
+            {
+                RotationList.Add(temp.ToString());
+            }
+        }
+
+        private List<string> _fontSizeList = new List<string>();
+        public List<string> FontSizeList
+        {
+            get { return _fontSizeList; }
+            set
+            {
+                SetProperty(ref _fontSizeList, value);
+            }
+        }
+
+        private void InitFontSizeList()
+        {
+            FontSizeList.Clear();
+            FontSizeList.Add("自动");
+            for (int temp = 8; temp <= 15; temp += 1)
+            {
+                FontSizeList.Add(temp.ToString() + "pt");
+            }
+        }
+
+        private List<string> _scaleList = new List<string>();
+        public List<string> ScaleList
+        {
+            get { return _scaleList; }
+            set
+            {
+                SetProperty(ref _scaleList, value);
+            }
+        }
+
+        private void InitScaleList()
+        {
+            ScaleList.Clear();
+            for (int temp = 0; temp <= 100; temp += 10)
+            {
+                ScaleList.Add(temp.ToString() + " %");
+            }
+        }
+
+        private List<string> _isFrontList = new List<string>();
+        public List<string> IsFrontList
+        {
+            get { return _isFrontList; }
+            set
+            {
+                SetProperty(ref _isFrontList, value);
+            }
+        }
+
+        private void InitIsFrontList()
+        {
+            IsFrontList.Clear();
+            IsFrontList.Add("位于页面上方");
+            IsFrontList.Add("位于页面下方");
+        }
+
+        private int _rotationValue = 0;
+        public int RotationValue
+        {
+            get { return _rotationValue; }
+            set
+            {
+                SetProperty(ref _rotationValue, value);
+            }
+        }
+
+        private int _opacityValue = 100;
+        public int OpacityValue
+        {
+            get { return _opacityValue; }
+            set
+            {
+                SetProperty(ref _opacityValue, value);
+            }
+        }
+
+        private int _relativeScaleValue = 50;
+        public int RelativeScaleValue
+        {
+            get { return _relativeScaleValue; }
+            set
+            {
+                SetProperty(ref _relativeScaleValue, value);
+            }
+        }
+
+        private string _vertOffsetValue = "0";
+        public string VertOffsetValue
+        {
+            get { return _vertOffsetValue; }
+            set
+            {
+                SetProperty(ref _vertOffsetValue, value);
+            }
+        }
+
+        private string _horizOffsetValue = "0";
+        public string HorizOffsetValue
+        {
+            get { return _horizOffsetValue; }
+            set
+            {
+                SetProperty(ref _horizOffsetValue, value);
+            }
+        }
+
+        private string _verticalSpacingValue = "6";
+        public string VerticalSpacingValue
+        {
+            get { return _verticalSpacingValue; }
+            set
+            {
+                SetProperty(ref _verticalSpacingValue, value);
+            }
+        }
+
+        private string _horizontalSpacingValue = "6";
+        public string HorizontalSpacingValue
+        {
+            get { return _horizontalSpacingValue; }
+            set
+            {
+                SetProperty(ref _horizontalSpacingValue, value);
+            }
+        }
+
         public WatermarkCreateTextContentViewModel()
         {
 
         }
+        private void InitList() {
+            InitOpacityList();
+            InitFontSizeList();
+            InitIsFrontList();
+            InitRotationList();
+            InitScaleList();
+        }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
@@ -25,6 +196,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            InitList();
         }
     }
 }

+ 2 - 2
PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml

@@ -20,7 +20,7 @@
             <RowDefinition Height="40"></RowDefinition>
             <RowDefinition></RowDefinition>
         </Grid.RowDefinitions>
-        <Grid Grid.Row="0" Background="AntiqueWhite">
+        <Grid Grid.Row="0" Background="#FFFFFF">
             <Border x:Name="ToolsBorder" BorderBrush="#1A000000" BorderThickness="0,1,0,1" Height="40">
                 <WrapPanel HorizontalAlignment="Center" Height="40">
                     <Button Style="{StaticResource InsideBarBtnStyle }">
@@ -64,7 +64,7 @@
                 <ColumnDefinition></ColumnDefinition>
                 <ColumnDefinition Width="260"></ColumnDefinition>
             </Grid.ColumnDefinitions>
-            <Grid Grid.Column="0" Background="DarkSlateBlue" >
+            <Grid Grid.Column="0" Background="#E7E9EC" >
                 <Border  Height="64" Width="293" HorizontalAlignment="Center"  VerticalAlignment="Bottom"  Panel.ZIndex="1" Margin="9" Background="#323232" CornerRadius="4">
 
                     <Grid>

+ 10 - 10
PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml

@@ -32,18 +32,18 @@
                     <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                         <StackPanel Orientation="Horizontal">
                             <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0"></cus:CommonWritableComboBox>
+                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="0" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         </StackPanel>
                         <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
                             <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="100 %" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         </StackPanel>
                     </StackPanel>
-                    <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
-                    <CheckBox Margin="0,11,0,0" >
+                    <ComboBox Height="32" Margin="0,8,0,0" ItemsSource="{Binding IsFrontList}"></ComboBox>
+                    <CheckBox Margin="0,11,0,0" Name="RelativeScaleCheckBox">
                         <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
                     </CheckBox>
-                    <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></cus:CommonWritableComboBox>
+                    <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0" TypeSouce="{Binding ScaleList}" IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}" Text="50 %" Value="{Binding RelativeScaleValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                 </StackPanel>
             </Grid>
             <Grid  Grid.Row="1"  Margin="16,10,16,0" Width="228">
@@ -74,26 +74,26 @@
                         <StackPanel Orientation="Vertical" Margin="70,0,0,0">
                             <StackPanel Orientation="Horizontal">
                                 <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
-                                <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                                <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizOffsetValue,Mode=TwoWay}"></cus:NumericUpDown>
                             </StackPanel>
                             <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                                 <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
-                                <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                                <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding VertOffsetValue,Mode=TwoWay}"></cus:NumericUpDown>
                             </StackPanel>
                         </StackPanel>
 
                     </StackPanel>
-                    <CheckBox Margin="0,24,0,0" >
+                    <CheckBox Margin="0,24,0,0" Name="IsFullCheckBox">
                         <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
                     </CheckBox>
                     <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                         <StackPanel Orientation="Horizontal">
                             <TextBlock Text="" Background="Aquamarine" Width="25" Height="9" VerticalAlignment="Center"/>
-                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalSpacingValue,Mode=TwoWay}" IsEnabled="{Binding ElementName=IsFullCheckBox,Path=IsChecked}"></cus:NumericUpDown>
                         </StackPanel>
                         <StackPanel Orientation="Horizontal" Margin="32,0,0,0">
                             <TextBlock Background="AntiqueWhite" Width="9" Height="25" VerticalAlignment="Center"/>
-                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0" Text="{Binding VerticalSpacingValue,Mode=TwoWay}" IsEnabled="{Binding ElementName=IsFullCheckBox,Path=IsChecked}"></cus:NumericUpDown>
                         </StackPanel>
                     </StackPanel>
                 </StackPanel>

+ 12 - 12
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

@@ -21,7 +21,7 @@
                 <TextBox Height="72" Margin="0,16,0,0" Text="一个水印" FontSize="14"></TextBox>
                 <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                     <ComboBox Width="154" Height="32"></ComboBox>
-                    <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                    <ComboBox Width="66" Height="32" Margin="8,0,0,0" ItemsSource="{Binding FontSizeList}" ></ComboBox>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                     <StackPanel Orientation="Horizontal">
@@ -42,18 +42,18 @@
                 <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                     <StackPanel Orientation="Horizontal">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="0" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="100 %" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                 </StackPanel>
-                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
-                <CheckBox Margin="0,11,0,0" >
+                <ComboBox Height="32" Margin="0,8,0,0" ItemsSource="{Binding IsFrontList}"></ComboBox>
+                <CheckBox Margin="0,11,0,0" Name="RelativeScaleCheckBox">
                     <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
                 </CheckBox>
-                <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></cus:CommonWritableComboBox>
+                <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0" TypeSouce="{Binding ScaleList}" IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}" Text="50 %" Value="{Binding RelativeScaleValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
             </StackPanel>
         </Grid>
         <Grid  Grid.Row="2"  Margin="0,10,0,0" Width="228">
@@ -84,26 +84,26 @@
                     <StackPanel Orientation="Vertical" Margin="70,0,0,0">
                         <StackPanel Orientation="Horizontal">
                             <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
-                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizOffsetValue,Mode=TwoWay}"></cus:NumericUpDown>
                         </StackPanel>
                         <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                             <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
-                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding VertOffsetValue,Mode=TwoWay}"></cus:NumericUpDown>
                         </StackPanel>
                     </StackPanel>
                     
                 </StackPanel>
-                <CheckBox Margin="0,24,0,0" >
+                <CheckBox Margin="0,24,0,0" Name="IsFullCheckBox">
                     <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
                 </CheckBox>
                 <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                     <StackPanel Orientation="Horizontal">
                         <TextBlock Text="" Background="Aquamarine" Width="25" Height="9" VerticalAlignment="Center"/>
-                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalSpacingValue,Mode=TwoWay}" IsEnabled="{Binding ElementName=IsFullCheckBox,Path=IsChecked}"></cus:NumericUpDown>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="32,0,0,0">
                         <TextBlock Background="AntiqueWhite" Width="9" Height="25" VerticalAlignment="Center"/>
-                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0" Text="{Binding VerticalSpacingValue,Mode=TwoWay}" IsEnabled="{Binding ElementName=IsFullCheckBox,Path=IsChecked}"></cus:NumericUpDown>
                     </StackPanel>
                 </StackPanel>
             </StackPanel>
@@ -111,7 +111,7 @@
         <Grid Width="228" Grid.Row="4"  Margin="0,8,0,4">
             <StackPanel Orientation="Vertical">
                 <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
-                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
+                <cus:WritableComboBox Height="32" Margin="0,8,0,0"></cus:WritableComboBox>
             </StackPanel>
         </Grid>
     </Grid>