I am not getting EventToCommand. My assembly is as followes

<Window x:Class="EfesBetGUI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vmMainWindow="clr-namespace:EfesBetGUI.ViewModel"
        xmlns:DateTimeUC="clr-namespace:EfesBetGUI.View.UserControls"        
        xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
        xmlns:cmd="clr-namespace:GalaSoft.MvvmLight;assembly=GalaSoft.MvvmLight.WPF4"
        xmlns:mvvmgalasoftCommand="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WPF4"
        xmlns:LightCmd="http://www.galasoft.ch/mvvmlight"
        xmlns:util="clr-namespace:EfesBetGUI.Util"
        Title="MainWindow" >

but inspite of that also I am not getting EventToCommand .I would like to mention Iam using framework 4.0 and visual studio 12. Any help is welcome.Thanking you, enter image description here

有帮助吗?

解决方案

As suggested here, the EventToCommand class sits in the Extras dll, so I would try the following xmlns:

xmlns:mvvmgalasoftCommand="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"

Note that I've added the Extras in the assembly name. not sure if you need the WPF4 suffix, you can try it with/without it and see if it works

其他提示

How about using directly:

<i:InvokeCommandAction Command="{Binding YourCommand}" />
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top