ReadViewContent.xaml.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using PDF_Master.ViewModels.PropertyPanel.ViewModular;
  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. using System.Windows.Threading;
  17. namespace PDF_Master.Views.PropertyPanel.ViewModular
  18. {
  19. /// <summary>
  20. /// ReadViewContent.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class ReadViewContent : UserControl
  23. {
  24. public ReadViewContent()
  25. {
  26. InitializeComponent();
  27. }
  28. /// <summary>
  29. /// 鼠标移动到控件范围时显示控件
  30. /// </summary>
  31. /// <param name="sender"></param>
  32. /// <param name="e"></param>
  33. private void RectangleReadMode_MouseEnter(object sender, MouseEventArgs e)
  34. {
  35. //Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
  36. //{
  37. if ((this.DataContext as ReadViewContentViewModel).ViewContentViewModel.mainViewModel.IsBookMode)
  38. {
  39. this.ReadModeContent.Visibility = Visibility.Visible;
  40. this.RectangleReadMode.Visibility = Visibility.Collapsed;
  41. }
  42. //}));
  43. }
  44. /// <summary>
  45. /// 鼠标移开页面控件,三秒后隐藏该控件
  46. /// </summary>
  47. /// <param name="sender"></param>
  48. /// <param name="e"></param>
  49. private async void ReadModeContent_MouseLeave(object sender, MouseEventArgs e)
  50. {
  51. await System.Threading.Tasks.Task.Delay(3000);
  52. //Thread.Sleep(3000);
  53. this.ReadModeContent.Visibility = Visibility.Collapsed;
  54. this.RectangleReadMode.Visibility = Visibility.Visible;
  55. }
  56. private void UserControl_KeyDown(object sender, KeyEventArgs e)
  57. {
  58. }
  59. }
  60. }