I would like to insert a separator between items in a ListView, like in the image below.
There are 2 problems:
- If I add it (as a Border) at the bottom of the item in the
ItemTemplate, the last item will have a separator, and it should not. - If I find a way to add a separator outside the
ItemTemplate, how would I align it to the labels?

You need to use a
DataTemplateSelectorfor this. First you need to create TwoDataTemplate'sFor example: In a simple ItemsControl which I want to show you a list of String, My Two
DataTemplate's would look like below.Now I create a
DataTemplateSelectorand Check if the Item that I need to apply theDataTemplateis Last one or not.Now my
ItemsControlImplementation would beHere is how i set the ItemsSource to ItemsControl
Below is your output. You can see Last Item does not have a
Border