I have a listbox with binded items. The items come from a collection, and have a date as a property.
I would like to display a line between two items of the listbox if the difference between their date is superior to 12 hours.
I don't know how to handle the fact that the code should look at 2 items in the collection and compare the values to display or not display the line.
I am a beginner so detai开发者_JAVA百科ls will be apreciated :) Many thanks for your help. Best, Arthur
Well, you don't have the ability to see what the next item is directly from XAML, so what you can do, is to calculate it in code, and insert a different element that denotes there to be a line.
Then you can use a DataTemplateSelector to allowing you to have different data-templates based on a condition (like a boolean "IsLine").
精彩评论