Ver código fonte

书签,enter

OYXH\oyxh 2 anos atrás
pai
commit
2092861cce

+ 3 - 4
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -78,13 +78,9 @@ namespace PDF_Office.ViewModels.BOTA
         #region 命令
 
         public DelegateCommand<object> KeyDownCommand { get; set; }
-        public DelegateCommand<object> MouseEnterCommand { get; set; }
-        public DelegateCommand<object> MouseLeaveCommand { get; set; }
 
         public DelegateCommand<object> LostFocusCommand { get; set; }
 
-        public DelegateCommand<object> GotFocusCommand { get; set; }
-
         public DelegateCommand<object> AddBookmarkCommand { get; set; }
 
         public DelegateCommand<object> ListViewItemMouseDownCommand { get; set; }
@@ -126,6 +122,9 @@ namespace PDF_Office.ViewModels.BOTA
                         TextBox textBox = (TextBox)keyEventArgs.OriginalSource;
                         ListViewItem listViewItem = CommonHelper.FindVisualParent<ListViewItem>(textBox);
                         UpdateTitle(listViewItem, textBox);
+                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listViewItem);
+                        textBlock.Text = textBox.Text;
+                        textBlock.Visibility = Visibility.Visible;
                     }
                 }
             }

+ 2 - 0
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -72,6 +72,8 @@ namespace PDF_Office.Views.BOTA
             }
             else if (e.RightButton == MouseButtonState.Pressed)
             {
+                if (e.ClickCount == 1)
+                    viewModel.ListViewItemMouseDownCommand.Execute(sender);
                 listBoxItem.IsSelected = true;
                 listBoxItem.Focus();
             }