In WPF: How can i pass the index of a ItemsSource loop as a CommandParameter?
<ItemsControl ItemsSource="{Binding PageList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button
Content="{Binding Name}"
Command="{Binding DataContext.ChangePageCommand, ElementName=Window}"
CommandParameter="INDEX OF ACTUAL ITEM AT ITEMSSOURCE GOES HERE" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
So, what i want is to pass the pushed button number to the Command method.
Thank you!