В моем xaml у меня есть ItemControl, который внутри имеет некоторые элементы управления сверху, например, wrappanel и Buttons. Когда пользователь нажимает на кнопку, как я могу узнать ее itemindex?Указатель выбранного элемента в ItemsControl
<ItemsControl ItemsSource="{Binding ConditionList}" AlternationCount="{Binding ConditionList.Count}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<WrapPanel Background="#FFB1CBCB">
<ComboBox ItemsSource="{Binding DataContext.NodeMembershipFunction, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}, AncestorLevel=1}}" DisplayMemberPath="_Name" SelectedValue="{Binding Condition, Mode=TwoWay}" SelectedValuePath="_Type"></ComboBox>
<Button Content="Remove" Click="Remove_Click" />
</WrapPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
индекс позиции в списке? ConditionList? – stsur