小编Dom*_*ikP的帖子

Windows Phone 8.1 - MVVMLight - 为什么EventToCommad不起作用?

我无法在Windows Phone 8.1应用程序中使用EventToCommand.

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"
Run Code Online (Sandbox Code Playgroud)

我也尝试使用assembly = GalaSoft.MvvmLight.Extras.WP81 ...

<controls:PivotItem Name="pivotItem">
<i:Interaction.Triggers>
    <i:EventTrigger EventName="SelectionChanged">
        <cmd:EventToCommand Command="{Binding SelectServiceCommand}"
                            CommandParameter="{Binding SelectedIndex,                                 ElementName=pivotItem}"/>
    </i:EventTrigger>
    <!-- other stuff  -->
</i:Interaction.Triggers>
Run Code Online (Sandbox Code Playgroud)

我得到以下错误:

  • 成员"触发器"无法识别或无法访问.
  • XML命名空间'clr-namespace中的未知类型'EventTrigger':System.Windows.Interactivity; assembly = System.Windows.Interactivity'
  • 错误2在"交互"类型中找不到可附加属性"触发器"....

有谁可以帮助我吗?

mvvm-light eventtocommand windows-phone-8 windows-phone-8.1

5
推荐指数
1
解决办法
2754
查看次数