Hi,
I'm using M-V-VM and have a command on my ViewModel called 'EntitySelectedCommand'.
I've trying to get all the Items in an ItemsControl to fire this command, however it's not working.
I think it's because each items 'datacontext' is the individual object the item is bound to, rather than the ViewModel?
Can anyone point me in the right direction please?
Cheers,
Andy
<ItemsControl ItemsSource="{Binding Path=LinkedSuppliers}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<Controls:EntityLabel Grid.Column="0" Grid.Row="0" Content="{Binding Name}" CurrentEntity="{Binding }" EntitySelected="{Binding EntitySelectedCommand}" ></Controls:EntityLabel>
<StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>