문제

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