学海无涯

导航

TextBox.InputBindings 绑定按键事件

 <TextBox Text="{Binding Search, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                             VerticalAlignment="Center" Width="250" md:HintAssist.Hint="查找待办事项"
                             md:TextFieldAssist.HasClearButton="True">
                        <TextBox.InputBindings>
                            <KeyBinding Key="Enter" Command="{Binding ExecuteCommand}" CommandParameter="查询" />
                        </TextBox.InputBindings>
                    </TextBox>

  

posted on 2022-12-29 14:00  宁静致远.  阅读(136)  评论(0编辑  收藏  举报