BookmarkContent.xaml.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using PDF_Office.ViewModels.BOTA;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace PDF_Office.Views.BOTA
  17. {
  18. /// <summary>
  19. /// BookmarkContent.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class BookmarkContent : UserControl
  22. {
  23. public BookmarkContent()
  24. {
  25. InitializeComponent();
  26. }
  27. private void TxtTitleInput_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  28. {
  29. if (sender is TextBox && IsLoaded)
  30. {
  31. TextBox textBox = sender as TextBox;
  32. if (textBox.Visibility == Visibility.Visible)
  33. {
  34. textBox.Focus();
  35. }
  36. }
  37. }
  38. private void ListViewItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  39. {
  40. var vm = this.DataContext as BookmarkContentViewModel;
  41. object[] objects = new object[] { sender, e };
  42. vm.ListViewItemMouseDownCommand.Execute(objects);
  43. }
  44. }
  45. }