|
@@ -99,6 +99,18 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private bool CanIsEnabled()
|
|
|
+ {
|
|
|
+ if (AnnotationListItems.Count > 0)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<string> colors = new List<string>();
|
|
|
private List<string> authors = new List<string>();
|
|
|
private List<AnnotArgsType> annotArgsTypes = new List<AnnotArgsType>();
|
|
@@ -106,8 +118,8 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
public DelegateCommand<object> ListBoxItemPreviewMouseLeftButtonDown { get; set; }
|
|
|
public DelegateCommand<object> AddNotesCommand { get; set; }
|
|
|
public DelegateCommand<object> ScreenCommand { get; set; }
|
|
|
- public DelegateCommand<object> ExportCommentsCommand { get; set; }
|
|
|
- public DelegateCommand<object> ImportCommentsCommand { get; set; }
|
|
|
+ public DelegateCommand ExportCommentsCommand { get; set; }
|
|
|
+ public DelegateCommand ImportCommentsCommand { get; set; }
|
|
|
public DelegateCommand<object> DeleteCommand { get; set; }
|
|
|
|
|
|
public DelegateCommand DeleteAllCommand { get; set; }
|
|
@@ -125,20 +137,32 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
ListBoxItemPreviewMouseLeftButtonDown = new DelegateCommand<object>(ListBoxItem_PreviewMouseLeftButtonDown);
|
|
|
AddNotesCommand = new DelegateCommand<object>(AddNotesEvent);
|
|
|
ScreenCommand = new DelegateCommand<object>(ScreenEvent);
|
|
|
- ExportCommentsCommand = new DelegateCommand<object>(ExportCommentsEvent);
|
|
|
- ImportCommentsCommand = new DelegateCommand<object>(ImportCommentsEvent);
|
|
|
+ ExportCommentsCommand = new DelegateCommand(ExportCommentsEvent, CanIsEnabled).ObservesProperty(() => AnnotationListItems);
|
|
|
+ ImportCommentsCommand = new DelegateCommand(ImportCommentsEvent);
|
|
|
DeleteCommand = new DelegateCommand<object>(DelegateEvent);
|
|
|
- DeleteAllCommand = new DelegateCommand(DeleteAllEvent);
|
|
|
+ DeleteAllCommand = new DelegateCommand(DeleteAllEvent, CanIsEnabled).ObservesProperty(() => AnnotationListItems);
|
|
|
PageSortCommand = new DelegateCommand(PageSortEvent);
|
|
|
TimeAscendingCommand = new DelegateCommand(TimeAscendingEvent);
|
|
|
TimeDescendingCommand = new DelegateCommand(TimeDescendingEvent);
|
|
|
}
|
|
|
|
|
|
+ public void HiddenAnnot()
|
|
|
+ {
|
|
|
+ AnnotationListItems.Clear();
|
|
|
+ IsEmptyPanelVisibility = Visibility.Visible;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void DisplayAnnot()
|
|
|
+ {
|
|
|
+ AnnotationListItems = GetDocumentAnnotionList();
|
|
|
+ RefreshAnnotationListItems();
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 导入注释
|
|
|
/// </summary>
|
|
|
/// <param name="obj"></param>
|
|
|
- private async void ImportCommentsEvent(object obj)
|
|
|
+ private async void ImportCommentsEvent()
|
|
|
{
|
|
|
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
|
|
|
dlg.Filter = "PDF|*.xfdf";
|
|
@@ -263,7 +287,6 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
if (result)
|
|
|
{
|
|
|
RemoveItem(annotation);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -330,7 +353,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
/// 导出注释
|
|
|
/// </summary>
|
|
|
/// <param name="obj"></param>
|
|
|
- private void ExportCommentsEvent(object obj)
|
|
|
+ private void ExportCommentsEvent()
|
|
|
{
|
|
|
if (ViewContentViewModel.CanSave)
|
|
|
{
|
|
@@ -429,7 +452,7 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
/// 刷新列表数据
|
|
|
/// </summary>
|
|
|
/// <param name="button"></param>
|
|
|
- private async void RefreshAnnotationListItems(System.Windows.Controls.Button button)
|
|
|
+ private async void RefreshAnnotationListItems(System.Windows.Controls.Button button = null)
|
|
|
{
|
|
|
switch (AnnotationSortOrder)
|
|
|
{
|
|
@@ -1035,10 +1058,12 @@ namespace PDF_Office.ViewModels.BOTA
|
|
|
|
|
|
#endregion BOTA,注释列表,添加在页面上的注释要默认按照页面上的位置排序,从上往下,从左往右排列
|
|
|
|
|
|
+ CurrentAnnotationLists = GetDocumentAnnotionList();
|
|
|
+
|
|
|
AnnotationListItems = new ObservableCollection<AnnotationHandlerEventArgs>();
|
|
|
|
|
|
AnnotationListItems = GetDocumentAnnotionList();
|
|
|
- CurrentAnnotationLists.AddRange(AnnotationListItems);
|
|
|
+
|
|
|
AnnotationListItems.CollectionChanged += AnnotationListItems_CollectionChanged;
|
|
|
//按照PageIndex,分组 排序
|
|
|
ICollectionView iCollectionView = CollectionViewSource.GetDefaultView(AnnotationListItems);
|