Before you mark this question as a duplicate or suggest using Items.IndexOf, please do the following:
public MainWindow()
{
InitializeComponent();
var A = new object();
var B = new object();
var C = new object();
lbItems.Items.Add(A);
lbItems.Items.Add(B);
lbItems.Items.Add(C);
lbItems.Items.Add(A);
lbItems.Items.Add(B);
lbItems.Items.Add(C);
}
private void lbItems_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
MessageBox.Show(lbItems.Items.IndexOf(lbItems.SelectedItems[0]).ToString());
}
Then doubleclick fourth element (you'll get 0 instead of 3).
How to get a list of selected item indices?