I only use the MVVM Light libraries (from the Nuget package) in my Windows Phone 8 project, and I want to use EventToCommand in ToggleSwitch . I have these lines of code:
<toolkit:ToggleSwitch x:Name="LockSwitch" IsChecked="{Binding IsLock, Mode=TwoWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Toggled"> <Command:EventToCommand Command="{Binding DataContext.NavigateToArticleCommand, ElementName=LayoutRoot}" CommandParameter="{Binding}" /> </i:EventTrigger> </i:Interaction.Triggers> </toolkit:ToggleSwitch>
The problem is that VS is showing errors:
Error 1 The name "EventToCommand" does not exist in the namespace "CLR names: GalaSoft.MvvmLight.Command; assembly = GalaSoft.MvvmLight.Extras.WP8".
Error 2 Type "Command: EventToCommand" not found. Confirm that you are missing a build link and that all build links have been built.
Error 3 The tag 'EventToCommand' does not exist in the XML namespace of the CLR names: GalaSoft.MvvmLight.Command; assembly = GalaSoft.MvvmLight.Extras.WP8 '.
I have the lines above in the Styles.xaml file, which is a ResourceDictionary and ToggleSwitch is part of a DataTemplate . I use this library in the MvvmLight library:
xmlns:Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"
What happened? Why am I getting this error? I tried to use Google, but I could not find a solution.
source share