|
@@ -31,6 +31,14 @@ namespace PDF_Office.ViewModels.Form
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //平均对齐布局
|
|
|
|
+ private bool _isLayoutAvgAlign = false;
|
|
|
|
+ public bool IsLayoutAvgAlign { get { return _isLayoutAvgAlign; } set { SetProperty(ref _isLayoutAvgAlign, value); } }
|
|
|
|
+ //对齐布局
|
|
|
|
+
|
|
|
|
+ private bool _isLayoutAlign = false;
|
|
|
|
+ public bool IsLayoutAlign { get { return _isLayoutAlign; } set { SetProperty(ref _isLayoutAlign, value); } }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 变量
|
|
#region 变量
|
|
@@ -53,6 +61,8 @@ namespace PDF_Office.ViewModels.Form
|
|
public DelegateCommand<string> CheckedCommand { get; set; }
|
|
public DelegateCommand<string> CheckedCommand { get; set; }
|
|
public DelegateCommand CancleCheckedCommand { get; set; }
|
|
public DelegateCommand CancleCheckedCommand { get; set; }
|
|
public DelegateCommand<string> ClickCommand { get; set; }
|
|
public DelegateCommand<string> ClickCommand { get; set; }
|
|
|
|
+ public DelegateCommand<object> AlignmentCheckedCommand { get; set; }
|
|
|
|
+
|
|
|
|
|
|
public event EventHandler<string> UncheckedToolsBtnEvent;
|
|
public event EventHandler<string> UncheckedToolsBtnEvent;
|
|
|
|
|
|
@@ -67,6 +77,7 @@ namespace PDF_Office.ViewModels.Form
|
|
CheckedCommand = new DelegateCommand<string>(CheckedEvent);
|
|
CheckedCommand = new DelegateCommand<string>(CheckedEvent);
|
|
CancleCheckedCommand = new DelegateCommand(CancleChecked);
|
|
CancleCheckedCommand = new DelegateCommand(CancleChecked);
|
|
ClickCommand = new DelegateCommand<string>(ClickEvent);
|
|
ClickCommand = new DelegateCommand<string>(ClickEvent);
|
|
|
|
+ AlignmentCheckedCommand = new DelegateCommand<object>(AlignmentChecked);
|
|
InitBtnToProperty();
|
|
InitBtnToProperty();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -116,6 +127,41 @@ namespace PDF_Office.ViewModels.Form
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void AlignmentChecked(object obj)
|
|
|
|
+ {
|
|
|
|
+ if(obj != null)
|
|
|
|
+ {
|
|
|
|
+ var tag = (string)obj;
|
|
|
|
+ switch(tag)
|
|
|
|
+ {
|
|
|
|
+ case "Left":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.AlignLeft);
|
|
|
|
+ break;
|
|
|
|
+ case "Vertical":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.AlignVerticalCenter);
|
|
|
|
+ break;
|
|
|
|
+ case "Right":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.AlignRight);
|
|
|
|
+ break;
|
|
|
|
+ case "Top":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.AlignTop);
|
|
|
|
+ break;
|
|
|
|
+ case "Horizontal":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.AlignHorizonCenter);
|
|
|
|
+ break;
|
|
|
|
+ case "Lower":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.AlignBottom);
|
|
|
|
+ break;
|
|
|
|
+ case "Distribute Vertical":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.DistributeVertical);
|
|
|
|
+ break;
|
|
|
|
+ case "Distribute Horizontal":
|
|
|
|
+ PDFViewer.SetFormAligment(AlignModes.DistributeHorizontal);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private void AddToPropertyPanel(string type, WidgetArgs widget = null, UpdateAttributeHelper e = null)
|
|
private void AddToPropertyPanel(string type, WidgetArgs widget = null, UpdateAttributeHelper e = null)
|
|
{
|
|
{
|
|
if (btnToProperty.ContainsKey(type))
|
|
if (btnToProperty.ContainsKey(type))
|
|
@@ -162,9 +208,10 @@ namespace PDF_Office.ViewModels.Form
|
|
// 选中时
|
|
// 选中时
|
|
private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
|
|
private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
|
|
{
|
|
{
|
|
|
|
+ int count = 0;
|
|
if (e != null)
|
|
if (e != null)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ count = e.AnnotItemsList.Count;
|
|
var annotHandlerEventArgs = e.AnnotItemsList[0];
|
|
var annotHandlerEventArgs = e.AnnotItemsList[0];
|
|
if (annotHandlerEventArgs as WidgetArgs != null)
|
|
if (annotHandlerEventArgs as WidgetArgs != null)
|
|
{
|
|
{
|
|
@@ -176,6 +223,7 @@ namespace PDF_Office.ViewModels.Form
|
|
CurrentWidgetArgs.PageIndex == widgetArgs.PageIndex)
|
|
CurrentWidgetArgs.PageIndex == widgetArgs.PageIndex)
|
|
{
|
|
{
|
|
GetSelectWidget(widgetArgs, e);
|
|
GetSelectWidget(widgetArgs, e);
|
|
|
|
+ UpdateLayoutAlign(count);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -185,9 +233,28 @@ namespace PDF_Office.ViewModels.Form
|
|
UncheckedToolsBtnEvent?.Invoke(null, CurrentToolBtnType);
|
|
UncheckedToolsBtnEvent?.Invoke(null, CurrentToolBtnType);
|
|
CurrentToolBtnType = "";
|
|
CurrentToolBtnType = "";
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ UpdateLayoutAlign(count);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void UpdateLayoutAlign(int count)
|
|
|
|
+ {
|
|
|
|
+ if (count == 0 || count == 1)
|
|
|
|
+ {
|
|
|
|
+ IsLayoutAlign = false;
|
|
|
|
+ IsLayoutAvgAlign = false;
|
|
|
|
+ }
|
|
|
|
+ else if (count == 2)
|
|
|
|
+ {
|
|
|
|
+ IsLayoutAlign = true;
|
|
|
|
+ IsLayoutAvgAlign = false;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ IsLayoutAlign = true;
|
|
|
|
+ IsLayoutAvgAlign = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public WidgetArgs CurrentWidgetArgs;
|
|
public WidgetArgs CurrentWidgetArgs;
|
|
@@ -278,7 +345,7 @@ namespace PDF_Office.ViewModels.Form
|
|
PDFViewer.AnnotEditHandler += PDFViewer_AnnotEditHandler;
|
|
PDFViewer.AnnotEditHandler += PDFViewer_AnnotEditHandler;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
}
|
|
}
|