|
@@ -293,20 +293,6 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
isTabItem = true;
|
|
|
}
|
|
|
}
|
|
|
- //foreach (var item in views)
|
|
|
- //{
|
|
|
- // if (item is BOTAContent bOTAContent1)
|
|
|
- // {
|
|
|
- // bOTAContent = bOTAContent1;
|
|
|
- // bOTAContentViewModel = bOTAContent.DataContext as BOTAContentViewModel;
|
|
|
- // if (bOTAContentViewModel.CurrentBar == tabItemText)
|
|
|
- // {
|
|
|
- // isTabItem = true;
|
|
|
-
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
}
|
|
|
return isTabItem;
|
|
|
}
|
|
@@ -494,54 +480,53 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
private void DelBookMark_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- if (viewContentViewModel.OpenBOTA == false)
|
|
|
+ CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA);
|
|
|
+ if (bOTAContentVM != null && bOTA != null)
|
|
|
{
|
|
|
- viewContentViewModel.OpenBOTA = true;
|
|
|
- }
|
|
|
- bool isBook = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemBookMark");
|
|
|
- if (isBook == false)
|
|
|
- {
|
|
|
- bOTAContent.TabItemBookMark.IsSelected = true;
|
|
|
- }
|
|
|
- BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentViewModel, out BookmarkContent bookmark);
|
|
|
+ BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentVM, out BookmarkContent bookmark);
|
|
|
|
|
|
- int index = PDFViewer.CurrentIndex;
|
|
|
- //检测是否已存在相同数据
|
|
|
- CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
|
|
|
- if (bookmarkContentViewModel != null && bookmark != null && bOTAContent != null && list != null)
|
|
|
- {
|
|
|
- bookmarkContentViewModel.DeleteCommand.Execute(list);
|
|
|
- isAddBookMark = bookmarkContentViewModel.isAddBookMark;
|
|
|
+ int index = PDFViewer.CurrentIndex;
|
|
|
+ //检测是否已存在相同数据
|
|
|
+ CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
|
|
|
+ if (bookmarkContentViewModel != null && bookmark != null && bOTA != null && list != null)
|
|
|
+ {
|
|
|
+ bookmarkContentViewModel.DeleteCommand.Execute(list);
|
|
|
+ isAddBookMark = bookmarkContentViewModel.isAddBookMark;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- // bool isBook = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemBookMark");
|
|
|
-
|
|
|
- //if (isBook == false || viewContentViewModel.OpenBOTA == false)
|
|
|
- //{
|
|
|
- // viewContentViewModel.OpenBOTA = true;
|
|
|
- // bOTAContent.TabItemBookMark.IsSelected = true;
|
|
|
- //}
|
|
|
}
|
|
|
|
|
|
- private void AddBookMark_Click()
|
|
|
+ private void CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA)
|
|
|
{
|
|
|
if (viewContentViewModel.OpenBOTA == false)
|
|
|
{
|
|
|
viewContentViewModel.OpenBOTA = true;
|
|
|
}
|
|
|
- bool isBook = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemBookMark");
|
|
|
+ bool isBook = IsBOTATabItemShow(out bOTAContentVM, out bOTA, "TabItemBookMark");
|
|
|
if (isBook == false)
|
|
|
{
|
|
|
- bOTAContent.TabItemBookMark.IsSelected = true;
|
|
|
+ bOTA.TabItemBookMark.IsSelected = true;
|
|
|
}
|
|
|
- BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentViewModel, out BookmarkContent bookmark);
|
|
|
+ }
|
|
|
|
|
|
- if (bookmarkContentViewModel != null && bookmark != null && bOTAContent != null)
|
|
|
+ private void AddBookMark_Click()
|
|
|
+ {
|
|
|
+ CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA);
|
|
|
+ //if (viewContentViewModel.mainViewModel.IsBookMode)
|
|
|
+ //{
|
|
|
+ // this.events.GetEvent<ReadModeBOTAShowEvent>().Publish(new ReadModeBOTAShowArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsBOTAShow = true });
|
|
|
+ //}
|
|
|
+ if (bOTAContentVM != null && bOTA != null)
|
|
|
{
|
|
|
- //bookmarkContentViewModel.AddBookmarkCommand.Execute(bookmark.BookMarkListView);
|
|
|
- bookmark.BtnAddBookmark_Click(null, null);
|
|
|
- isAddBookMark = bookmarkContentViewModel.isAddBookMark;
|
|
|
- return;
|
|
|
+ BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentVM, out BookmarkContent bookmark);
|
|
|
+
|
|
|
+ if (bookmarkContentViewModel != null && bookmark != null && bOTA != null)
|
|
|
+ {
|
|
|
+ //bookmarkContentViewModel.AddBookmarkCommand.Execute(bookmark.BookMarkListView);
|
|
|
+ bookmark.BtnAddBookmark_Click(null, null);
|
|
|
+ isAddBookMark = bookmarkContentViewModel.isAddBookMark;
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -626,13 +611,13 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
if (item is MenuItem menuItem)
|
|
|
{
|
|
|
string str = menuItem.Tag.ToString();
|
|
|
- if (str == AddAnnotType.AnnotLink.ToString()
|
|
|
- || str == AddAnnotType.AnnotStamp.ToString()
|
|
|
- || str == AddAnnotType.AnnotAutograph.ToString()
|
|
|
- )
|
|
|
- {
|
|
|
- InBookModeSetIsEnabled(menuItem);
|
|
|
- }
|
|
|
+ //if (str == AddAnnotType.AnnotLink.ToString()
|
|
|
+ //|| str == AddAnnotType.AnnotStamp.ToString()
|
|
|
+ //|| str == AddAnnotType.AnnotAutograph.ToString()
|
|
|
+ //)
|
|
|
+ //{
|
|
|
+ // InBookModeSetIsEnabled(menuItem);
|
|
|
+ //}
|
|
|
menuItem.CommandParameter = item;
|
|
|
menuItem.Command = SetAddAnnotationCommand;
|
|
|
}
|