FormsToolContent.xaml.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace PDF_Office.Views.Form
  16. {
  17. /// <summary>
  18. /// FormsToolContent.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class FormsToolContent : UserControl
  21. {
  22. public FormsToolContent()
  23. {
  24. InitializeComponent();
  25. }
  26. private void BtnAlignment_Click(object sender, RoutedEventArgs e)
  27. {
  28. MenuAlignment.PlacementTarget = this.BtnAlignment;
  29. MenuAlignment.IsOpen = true;
  30. }
  31. /// <summary>
  32. /// 取消右键弹出下拉菜单
  33. /// </summary>
  34. /// <param name="sender"></param>
  35. /// <param name="e"></param>
  36. private void BtnAlignment_Initialized(object sender, EventArgs e)
  37. {
  38. //取消右键菜单的绑定,只能左键点击弹出
  39. this.BtnAlignment.ContextMenu = null;
  40. }
  41. private void BtnMore_Click(object sender, RoutedEventArgs e)
  42. {
  43. MenuMore.PlacementTarget = this.BtnMore;
  44. MenuMore.IsOpen = true;
  45. }
  46. private void BtnMore_Initialized(object sender, EventArgs e)
  47. {
  48. //取消右键菜单的绑定,只能左键点击弹出
  49. this.BtnMore.ContextMenu = null;
  50. }
  51. }
  52. }