这是我的问题,我想在按下此画布时传递整数1。每次点击画布时,我都会在GalaSoft.MvvmLight.dll中发生一个类型为“System.InvalidCastException”的未处理异常。现在,我可以让我的生活更轻松,只需执行RelayCommand即可接受String而不是int,但为了学习。我会如何做这种方式,在MVVM Light中投射CommandParameterValue
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<cmd:EventToCommand Command="{Binding ButtonPress}"
CommandParameterValue="1"
</i:EventTrigger>
</i:Interaction.Triggers>
这个作品为int,但是当我尝试使用 false 它跌倒了(它通过1或0) –
Damian
2011-01-29 22:49:27