|
@@ -39,6 +39,7 @@ using System.Runtime.Remoting.Messaging;
|
|
|
using ListView = System.Windows.Controls.ListView;
|
|
|
using PDF_Master.EventAggregators;
|
|
|
using Prism.Events;
|
|
|
+using System.Windows.Data;
|
|
|
|
|
|
namespace PDF_Master.ViewModels.BOTA
|
|
|
{
|
|
@@ -292,26 +293,31 @@ namespace PDF_Master.ViewModels.BOTA
|
|
|
/// <param name="obj"></param>
|
|
|
private void LostFocusEvent(object obj)
|
|
|
{
|
|
|
- TextBox textBox = null;
|
|
|
- ListViewItem listViewItem = null;
|
|
|
- if (obj is CompositeCommandParameter)
|
|
|
+ try
|
|
|
{
|
|
|
- CompositeCommandParameter parameter = (CompositeCommandParameter)obj;
|
|
|
- if (parameter.Parameter is TextBox)
|
|
|
+ //连续快捷键Ctrl+B 两次添加书签时会报错,暂时没有好的方式判断disconnecteditem 先异常捕获处理一下
|
|
|
+ TextBox textBox = null;
|
|
|
+ ListViewItem listViewItem = null;
|
|
|
+ if (obj is CompositeCommandParameter)
|
|
|
{
|
|
|
- textBox = (TextBox)parameter.Parameter;
|
|
|
- listViewItem = CommonHelper.FindVisualParent<ListViewItem>(textBox);
|
|
|
+ CompositeCommandParameter parameter = (CompositeCommandParameter)obj;
|
|
|
+ if (parameter.Parameter is TextBox)
|
|
|
+ {
|
|
|
+ textBox = (TextBox)parameter.Parameter;
|
|
|
+ listViewItem = CommonHelper.FindVisualParent<ListViewItem>(textBox);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (obj is ListBoxItem)
|
|
|
+ {
|
|
|
+ listViewItem = (ListViewItem)(obj);
|
|
|
+ textBox = CommonHelper.FindVisualChild<TextBox>(listViewItem);
|
|
|
}
|
|
|
- }
|
|
|
- if (obj is ListBoxItem)
|
|
|
- {
|
|
|
- listViewItem = (ListViewItem)(obj);
|
|
|
- textBox = CommonHelper.FindVisualChild<TextBox>(listViewItem);
|
|
|
- }
|
|
|
|
|
|
- CPDFBookmark bookmark = (CPDFBookmark)listViewItem.DataContext;
|
|
|
+ CPDFBookmark bookmark = (CPDFBookmark)listViewItem.DataContext;
|
|
|
|
|
|
- UpdateTitle(listViewItem, textBox);
|
|
|
+ UpdateTitle(listViewItem, textBox);
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|