using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; namespace Muchinfo.MTPClient.Account.Views { /// /// MessageView.xaml 的交互逻辑 /// public partial class MessageView : UserControl { public MessageView() { InitializeComponent(); this.dg_Message.MouseDoubleClick += dg_Message_MouseDoubleClick; } private void dg_Message_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var obj = e.OriginalSource as DependencyObject; while (obj != null && !(obj is System.Windows.Controls.Primitives.DataGridColumnHeader)) { obj = VisualTreeHelper.GetParent(obj); } if (obj != null) { e.Handled = true; } } private void Title_OnKeyUp(object sender, KeyEventArgs e) { //使用KeyUp,阻止键盘精灵弹出 e.Handled = true; } } }