BOTAContent.xaml.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using PDF_Office.Helper;
  2. using PDF_Office.ViewModels.BOTA;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  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.BOTA
  18. {
  19. /// <summary>
  20. /// BOTAContent.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class BOTAContent : UserControl
  23. {
  24. public BOTAContent()
  25. {
  26. InitializeComponent();
  27. }
  28. private void Border_MouseDown(object sender, MouseButtonEventArgs e)
  29. {
  30. }
  31. private void TabControl_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  32. {
  33. var visual = VisualTreeHelper.HitTest(TabBOTA, e.GetPosition(TabBOTA));
  34. if (visual == null)
  35. {
  36. return;
  37. }
  38. var item = CommonHelper.FindVisualParent<TabItem>(visual.VisualHit);
  39. if (item == null)
  40. {
  41. return;
  42. }
  43. ///重复点击选中项时,收起侧边栏
  44. if (item.IsSelected == true)
  45. {
  46. (this.DataContext as BOTAContentViewModel).viewContentViewModel.OpenBOTA = !(this.DataContext as BOTAContentViewModel).viewContentViewModel.OpenBOTA;
  47. }
  48. }
  49. private void CloseBOTACommand_Executed(object sender, ExecutedRoutedEventArgs e)
  50. {
  51. }
  52. }
  53. }