@NithinRamu Not sure how familiar you are with LINQ. You might want to do some research on that first.
But here is my attempt at an explanation:
var selectedItems = // var where selectedItems will be stored. MyListBox.Items.Cast<ListBoxItem>() // Goes through each item in the listbox casts its type to ListBoxItem, this is done because the sender/handler does not send this information .Where(p => p.IsSelected) // a filter which keeps only the selected items. .Select(t => t.Content.ToString()) // Converts each selected to a string type .ToArray(); // Converts selected strings into an array to be able to process them, this could have been a List (.ToList())
Also, @BobTabor: you've really got a way of explaining things. you're a natural teacher. thanks.