xaml - 有没有办法将参数(或多个参数)传递给 CallMethodAction 行为?

标签 xaml mvvm expression-blend

有没有办法将一个参数(或多个参数)传递给 CallMethodAction 行为?

最佳答案

尝试使用 InvokeCommandAction 命令而不是使用 CallMethodAction:

<i:Interaction.Triggers>
  <i:EventTrigger EventName="TextChanged">
    <i:InvokeCommandAction Command="{Binding TextChangedCommand}" 
        CommandParameter="{Binding ElementName=filterBox, Path=Text}"/>
  </i:EventTrigger>
</i:Interaction.Triggers>

希望能帮助到你

关于xaml - 有没有办法将参数(或多个参数)传递给 CallMethodAction 行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5073065/

相关文章:

.net - '/' 应用程序中的服务器错误。 - 没有相关源代码行.NET FRAMEWORK 4.0

c# - wpf 将列表框项目绑定(bind)到静态列表

c# - 更改 ViewModel 对象不会反射(reflect)对 View 的更改

c# - DraggableView C# Xamarin 的恢复位置命令

wpf - 将项目添加到 ObservableCollection 并使其在其绑定(bind)的 ListCollectionView 中被选中

windows-phone-7 - 如何使我的 ListPicker(来自 WP 工具包)可混合(MVVM Light)

wpf - 使用 Expression Blend 编辑使用 DataTemplateSelector 的项目的 DataTemplate

c# - WPF 中的 CommandLink

.net - MVVM View 模型 DTO

c# - 列表框的Scrollviewer根据项目数可见