public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is ListBoxItem))
            {
                throw new ArgumentException("value is not ListBoxItem.");
            }
            ListBoxItem listBoxItem = (ListBoxItem)value;
            ListBox     listBox     = listBoxItem.FindAncestor <ListBox>();

            if (listBox == null)
            {
                return(0);
            }
            return(listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1);
        }