|
@@ -100,12 +100,13 @@ namespace PDF_Office.ViewModels.FillAndSign
|
|
|
/// </summary>
|
|
|
public Dictionary<string, string> btnToProperty = new Dictionary<string, string>();
|
|
|
#endregion
|
|
|
-
|
|
|
+ string Unicode = "";
|
|
|
public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events)
|
|
|
{
|
|
|
|
|
|
regions = regionManager;
|
|
|
this.events = events;
|
|
|
+ Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
|
|
|
CheckCommand = new DelegateCommand<RoutedEventArgs>(CheckedEvent);
|
|
|
ToolExpandDict.Add("Freetext", AnnotArgsType.AnnotFreeText);
|
|
|
InitDictionary();
|
|
@@ -122,7 +123,7 @@ namespace PDF_Office.ViewModels.FillAndSign
|
|
|
#region 事件聚合器(来自AnnotToolContentViewModel)
|
|
|
private void SubscribeEvent()
|
|
|
{
|
|
|
- events.GetEvent<FillAndSignEvent>().Subscribe(FromFillAndSign);
|
|
|
+ events.GetEvent<FillAndSignEvent>().Subscribe(FromFillAndSign, e => e.AppUnicode == Unicode);
|
|
|
}
|
|
|
|
|
|
private void FromFillAndSign(FillAndSigntEventArgs obj)
|
|
@@ -131,8 +132,25 @@ namespace PDF_Office.ViewModels.FillAndSign
|
|
|
{
|
|
|
if(string.IsNullOrEmpty(obj.Unicode) == false)
|
|
|
{
|
|
|
- AnnotHandlerEventArgs annotArgs = null;
|
|
|
- FindAnnotTypeKey(obj.Unicode, ref annotArgs);
|
|
|
+ if(obj.Unicode == "Clear")
|
|
|
+ {
|
|
|
+ viewContentViewModel.FillAndSign.Clear();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(obj.Annots != null && obj.Annots.Count > 0)
|
|
|
+ {
|
|
|
+ if (obj.Annots[0].EventType == AnnotArgsType.AnnotFreehand)
|
|
|
+ {
|
|
|
+ GetFreehand(obj.Annots);
|
|
|
+ }
|
|
|
+ else if(obj.Annots[0].EventType == AnnotArgsType.AnnotFreeText)
|
|
|
+ {
|
|
|
+ GetFreetext(obj.Annots);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -835,7 +853,7 @@ namespace PDF_Office.ViewModels.FillAndSign
|
|
|
foreach (var itemAnnot in annots)
|
|
|
{
|
|
|
var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, annotAttribsList);
|
|
|
- PDFViewer.SelectAnnotation(itemAnnot.PageIndex, itemAnnot.AnnotIndex);
|
|
|
+ //PDFViewer.SelectAnnotation(itemAnnot.PageIndex, itemAnnot.AnnotIndex);
|
|
|
propertyPanel.AnnotEvents.Add(eventitem);
|
|
|
|
|
|
}
|