Is there a standard/best way to space items in a WPF ListBox
, such that there is space between consecutive items, but not above the first or below the last?
To me, the most obvious way to add spacing is to modify the ItemTemplate
to include space above, below, or both above and below each item. This, of course, means that there will be space above/below the first and/or last item, too, or a single item.
I could use triggers to select different templates for first, last, intermediate items, but wonder if there is something simpler that I'm missing -- seems that controlling spacing would be a common requirement.
Thanks.
NOTE: I am working in WPF, but assume this is similar if not identical in Silverlight XAML.