C#-WPF事件的绑定prism框架

前台代码

xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
<i:Interaction.Triggers>
      <i:EventTrigger EventName="TextChanged">
            <i:InvokeCommandAction Command="{Binding TextChangedCommand}" CommandParameter="{Binding ElementName=txtProcessText}" />
      </i:EventTrigger>
</i:Interaction.Triggers>

后台代码

private DelegateCommand<object> _textChangedCommand;
public DelegateCommand<object> TextChangedCommand => _textChangedCommand ??= new DelegateCommand<object>(ExecuteTextChangedCommand);

 

posted @ 2022-08-16 17:07  我养了根竹子  阅读(329)  评论(0编辑  收藏  举报