WPF TextBox内容修改命令

<TextBox

Background="{x:Null}"

Text="{Binding SearchForContent, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">

<i:Interaction.Triggers>

<i:EventTrigger EventName="TextChanged">
<i:InvokeCommandAction Command="{Binding TextChangedCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="LostFocus">
<i:InvokeCommandAction Command="{Binding LostFocusAndGotFocusCommand}" CommandParameter="LostFocus" />
</i:EventTrigger>
<i:EventTrigger EventName="GotFocus">
<i:InvokeCommandAction Command="{Binding LostFocusAndGotFocusCommand}" CommandParameter="GotFocus" />
</i:EventTrigger>

</i:Interaction.Triggers>

</TextBox>

xmlns:i="http://schemas.microsoft.com/xaml/behaviors"

后台的话根据需要,自己声明命令,命令事件即可

这玩意儿是开源的,需要下载ViewModelBase包

相关推荐
wtblszn5 小时前
农村供水站远程监控智能管理方案
大数据
aixingkong9216 小时前
华为灵衢超节点参考架构白皮书深度解读
大数据·人工智能·华为
大大大大晴天6 小时前
每天认识一个组件:Apache Iceberg
大数据
xiaoyunxuexibiji7 小时前
采购协同管理:从备货计划、进度确认到到货签收
大数据·运维·人工智能
测试盐8 小时前
spark作业日志定位过程
java·hadoop·spark
2601_957875208 小时前
华立科技荣获环球品牌与合作(大中华区)年度“最佳街机游戏合作伙伴”
大数据·科技·游戏
BJ_Bonree9 小时前
聊点技术 | Bonree ONE 业务链路观测实战 支付成功率下降,问题究竟出在哪一环?
大数据·人工智能
IT研究室10 小时前
最新大数据毕业设计选题推荐-基于大数据的Kaggle竞赛团队协作模式与效能可视化分析-大数据-Spark-Hadoop-Bigdata
大数据·spark·课程设计
骑着蜗牛撵大象32710 小时前
闲鱼捡漏自动化:关键词加价格上限先粗筛,AI 大模型再做第一轮判定
大数据·人工智能·ai·自动化·二手交易·闲鱼·关键词监控