Is there a universal XAML style or template method for displaying a list of data items as a delimited list on the screen?
Imagine the output of something like a function call declaration in XAML: foo(a,b,c)where "a", "b" and "c" are taken from a list of data. ("foo" is also a data binding, but not a parameter list)
The elements "a", "b", and "c" must remain XAML interface elements, so they can be interactive and customizable in XAML. (Therefore, I believe that this will disqualify a simple string concatenation as a solution)
The critical point in does not have a false end comma at the end of the list.
This is somewhat related to the question of how to style the first and / or last elements in the list differently from the middle elements . I saw suggestions here in stackoverflow to use ItemsTemplateSelectorin ItemsControlto check if the item is the first or last in the list and returns the corresponding template, but the problem with this is DataTemplateSelector.SelectTemplatethat it does not have access to the list from which the item came. You can crack the carnal knowledge of a certain list as a one-time shred, but how do you do it in general, reusable?
source
share