xaml - Context-sensitive data binding in WPF -
it's convenient assign listbox.itemssource
collection , tweak listbox.itemtemplate
make date want.
consider binding simple list of sorted strings.
if collection large enough, eye-catching anchors come handy.
here concept of want:
wpf example of databinding http://bteffective.com/images/data_bindining_example.png
basically want first letter of different style, if doesn't match letter of previous item. how can address previous item in datatemplate
?
you need parse source list new list of objects have 3 properties: first letter of word, rest of word, , boolean indicates if entry "anchor". then, datatemplate textblock first letter followed textblock rest of word. style trigger on isanchor boolean change color of first letter.
Comments
Post a Comment