我使用的是最新版本为4.1.26.24928的MVVMLight Tookit,并且正在使用WPF 4.5编写程序。
现在我无法在VS2012 XAML文件中使用EventToCommand,它显示"EventToCommand" does not exist in the namespace "clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WPF45"。
我的dll引用如下:
System.Windows.Interactivity (v4.5.0.0)
Galasoft.MvvmLight.WPF45 (v4.1.26.24928)
Galasoft.MvvmLight.Extras.WPF45 (v4.1.26.24928)
这是我的代码:
命名空间:
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WPF45"
文本块:
<TextBlock>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown">
<cmd:EventToCommand></cmd:EventToCommand>
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBlock>
我做错了什么吗?谢谢!
xmlns:cmd="http://www.galasoft.ch/mvvmlight"
。 - TinySnake