I am using WPF MVVM Light for one of my application. I found an error when I debugging my code is "EventToCommand.cs not found" on Window Loaded Command.
My Code is :
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:command="http://www.galasoft.ch/mvvmlight"
<i:Interaction.Triggers>
<i:EventTrigger EventName="Closing" >
<command:EventToCommand Command="{Binding WindowCloseCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger>
<i:EventTrigger EventName="Loaded" >
<command:EventToCommand Command="{Binding WindowLoadedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window},Mode=FindAncestor}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
In View Model:
public ICommand WindowLoadedCommand
{
get { return _windowLoadedCommand ?? (_windowLoadedCommand = new RelayCommand<MetroWindow>(OnWindowLoaded)); }
}
public void OnWindowLoaded(MetroWindow window)
{
}
Please help me to find out solution for this issue.