ReadModeContent.xaml.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using DryIoc;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace PDF_Office.Views.PropertyPanel.ViewModular
  18. {
  19. /// <summary>
  20. /// ReadModeContent.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class ReadModeContent : UserControl
  23. {
  24. public ReadModeContent()
  25. {
  26. InitializeComponent();
  27. }
  28. private void TxbCurrentPageNum_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  29. {
  30. if (e.ClickCount >= 2)
  31. {
  32. TxbCurrentPageNum.Visibility = Visibility.Collapsed;
  33. TxtCurrentPageNum.Dispatcher.BeginInvoke(new Action(() =>
  34. {
  35. TxtCurrentPageNum.Background = new SolidColorBrush(Colors.White);
  36. TxtCurrentPageNum.Focus();
  37. TxtCurrentPageNum.SelectAll();
  38. }));
  39. }
  40. }
  41. private void TxtCurrentPageNum_MouseLeave(object sender, RoutedEventArgs e)
  42. {
  43. TxbCurrentPageNum.Visibility = Visibility.Visible;
  44. TxtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
  45. }
  46. private void TxtCurrentPageNum_LostFocus(object sender, RoutedEventArgs e)
  47. {
  48. TxbCurrentPageNum.Visibility = Visibility.Visible;
  49. TxtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
  50. }
  51. private void TxtCurrentPageNum_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
  52. {
  53. TxbCurrentPageNum.Visibility = Visibility.Visible;
  54. TxtCurrentPageNum.Background = new SolidColorBrush(Colors.Transparent);
  55. }
  56. }
  57. }