MessageView.xaml.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Input;
  4. using System.Windows.Media;
  5. namespace Muchinfo.MTPClient.Account.Views
  6. {
  7. /// <summary>
  8. /// MessageView.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class MessageView : UserControl
  11. {
  12. public MessageView()
  13. {
  14. InitializeComponent();
  15. this.dg_Message.MouseDoubleClick += dg_Message_MouseDoubleClick;
  16. }
  17. private void dg_Message_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  18. {
  19. var obj = e.OriginalSource as DependencyObject;
  20. while (obj != null && !(obj is System.Windows.Controls.Primitives.DataGridColumnHeader))
  21. {
  22. obj = VisualTreeHelper.GetParent(obj);
  23. }
  24. if (obj != null)
  25. {
  26. e.Handled = true;
  27. }
  28. }
  29. private void Title_OnKeyUp(object sender, KeyEventArgs e)
  30. {
  31. //使用KeyUp,阻止键盘精灵弹出
  32. e.Handled = true;
  33. }
  34. }
  35. }