标签:end ted detail 获取 route void public vat property
原文:Wpf UserControl使用 KeyBinding,失效问题
我的问题根源是UserControl未获取相应焦点,在UserControl后台添加如下
public AccountDetailView()
{
InitializeComponent();
this.IsEnabledChanged +=new DependencyPropertyChangedEventHandler(AccountDetailView_IsEnabledChanged);
}
private void control_detail_Loaded(object sender, RoutedEventArgs e)
{
tb_detail.Focusable = true;
Keyboard.Focus(this);
}
void AccountDetailView_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (!Convert.ToBoolean(e.NewValue)) return;
this.Focusable = true;
Keyboard.Focus(this);
}
Wpf UserControl使用 KeyBinding,失效问题
标签:end ted detail 获取 route void public vat property
原文地址:https://www.cnblogs.com/lonelyxmas/p/12329548.html