我使用Mvvm light(wpf45)。
我想在XAML中添加EventToCommand,我使用这个
xmlns:cmd ="http://www.galasoft.ch/mvvmlight"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"但不要添加EventToCommand
<Button>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cmd:EventToCommand/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>我在<cmd:EventToCommand/>中遇到错误
发布于 2014-12-17 19:11:18
使用此参考,
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"你可以使用EventToCommand类。
希望对您有所帮助:)
发布于 2018-11-20 09:39:13
我认为你应该这样编码它。
<i:Interaction.Behaviors>
<i:EventToCommand EventName="YourPropertyEvent" Command="YourBinding"/>
</i:Interaction.Behaviors>https://stackoverflow.com/questions/17647574
复制相似问题