【发布时间】:2013-02-12 21:56:07
【问题描述】:
在没有代码隐藏的情况下连接 keydown 事件有一点问题! 所以,我们有组合框
<ComboBox Height="20" Width="auto"
ItemsSource="{Binding AlignComboItems}"
SelectedValue="{Binding SelectedComboItem, Mode=TwoWay}"
SelectedValuePath="Key" DisplayMemberPath="Value"
SelectedItem="{Binding SelectedItem}"
x:Name="cmbBoxAlign">
</ComboBox>
还有一些文本框。
<TextBox Text={Binding SomeSource}></TextBox>
如何捕捉 TextBox 上的 keydown 事件以选择(例如)ComboBox 中的最后一个元素?我不能使用 TextBox DataSource 属性更改,因为需要挂钩用户输入。
【问题讨论】:
标签: wpf mvvm binding triggers command