|
@@ -3,6 +3,7 @@ using ComPDFKitViewer.AnnotEvent;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
using PDF_Office.Helper;
|
|
|
using PDF_Office.Model;
|
|
|
+using PDF_Office.Model.From;
|
|
|
using Prism.Commands;
|
|
|
using Prism.Mvvm;
|
|
|
using Prism.Regions;
|
|
@@ -19,6 +20,15 @@ namespace PDF_Office.ViewModels.Form
|
|
|
{
|
|
|
#region 属性
|
|
|
|
|
|
+ #region 一般
|
|
|
+ private FormFieldType _formPos;
|
|
|
+ public FormFieldType FormPos
|
|
|
+ {
|
|
|
+ get { return _formPos; }
|
|
|
+ set { SetProperty(ref _formPos, value); ChangeFieldValue("FormPos"); }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
|
|
|
#region 选项
|
|
|
//默认值
|
|
@@ -193,47 +203,73 @@ namespace PDF_Office.ViewModels.Form
|
|
|
switch(e)
|
|
|
{
|
|
|
case FormAttributeType.Name:
|
|
|
+ textBoxArgs.FieldName = NameStr;
|
|
|
AttribEvent?.UpdateAttrib(AnnotAttrib.FieldName, NameStr);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.ToolTip:
|
|
|
+ textBoxArgs.Tooltip = ToolTipStr;
|
|
|
AttribEvent?.UpdateAttrib(AnnotAttrib.Tooltip, ToolTipStr);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.IsSolid:
|
|
|
+ textBoxArgs.BorderStyle = IsSolid;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.LineStyle, IsSolid);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.IsLocked:
|
|
|
textBoxArgs.Locked = IsLocked;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.Locked, IsLocked);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.HeightSize:
|
|
|
+ textBoxArgs.DefaultWidth = HeightSize;
|
|
|
+ //AttribEvent?.UpdateAttrib(, BorderThiness);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.BorderThiness:
|
|
|
+ textBoxArgs.LineWidth = BorderThiness;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.Thickness, BorderThiness);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.BorderColor:
|
|
|
+ textBoxArgs.LineColor = BorderColor;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.Color, BorderColor);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.ContentColor:
|
|
|
+ textBoxArgs.FontColor = ContentColor;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.FontColor, ContentColor);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.IsReadOnly:
|
|
|
+ textBoxArgs.ReadOnly = IsReadOnly;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.ReadOnly, IsReadOnly);
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.WidthSize:
|
|
|
break;
|
|
|
|
|
|
case FormAttributeType.IsRequiredField:
|
|
|
+ textBoxArgs.IsRequired = IsRequiredField;
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.IsRequired, IsRequiredField);
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
AttribEvent?.UpdateAnnot();
|
|
|
- //textBoxArgs.UpdateAnnotByEventArgs();
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void ChangeFieldValue(string tag)
|
|
|
+ {
|
|
|
+ switch(tag)
|
|
|
+ {
|
|
|
+ case "FormPos":
|
|
|
+ AttribEvent?.UpdateAttrib(AnnotAttrib.FormField,FormPos);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ AttribEvent?.UpdateAnnot();
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
}
|