I have a bound ListBox in WPF where each item has an up / down button to move the item up or down in the list box.
However I need to know which button fired the event so I want to set the name of the button to "UpButton" + listBoxItem.Text type of thing.
Here's a simplified version of the XAML
<ListBox>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Path=Position}"/>
<Label Grid.Column="1" Content="{Binding Path=Name}" FontSize="18" Margin="0,10,0,0" />
<WrapPanel Grid.Column="2" >
<Button Click="MoveUpClick" Name="UpButton">Up</Button>
<Button Click="MoveDownClick" Name="DownButton">Down</Button>
</WrapPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
If somebody knows of a control out there that provides similar sorting functionality and / or with DragDrop to sort it, I'd appreciate any help as I'm about 2 hours overdue for heading off on holiday.