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包

相关推荐
SelectDB14 小时前
Apache Doris Python UDF:让 SQL 直接调用 Python 生态,支撑 Agent 时代复杂业务逻辑
大数据·数据库·python
ApacheSeaTunnel17 小时前
当多表数据涌入,Apache SeaTunnel 如何巧妙化解主键冲突?
大数据·开源·数据集成·seatunnel·技术分享·数据同步
大大大大晴天4 天前
Hudi Metadata Table 与 Hive Sync (HMS)怎么选?
大数据
手可摘星辰7774 天前
一次线上FlinkCDC异常排查复盘
大数据·flink
大大大大晴天4 天前
Hudi技术内幕:Metadata Table原理与实践
大数据
大大大大晴天5 天前
Hudi技术内幕:深入解析Index索引机制
大数据
阿里云大数据AI技术5 天前
Flink Forward Asia 2026 深圳启幕:Agentic Streaming for AI,开启实时智能新范式
大数据·flink
SelectDB6 天前
阶跃星辰基于 SelectDB 构建 PB 级 Agent 可观测平台
大数据·数据库·aigc
大大大大晴天9 天前
Hudi技术内幕:RecordPayload到RecordMerger
大数据
SelectDB10 天前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生