I have an ItemsControl that binds to ICollectionView.
I need to tell from withing DataTemplate of an item, whether it is the current.
Note: This is possible from Listbox, but I want ItemsControl looks.
I have an ItemsControl that binds to ICollectionView.
I need to tell from withing DataTemplate of an item, whether it is the current.
Note: This is possible from Listbox, but I want ItemsControl looks.
I would do it with a MultiValueConverter which compares the data-templated item with the CurrentItem in the view, e.g.
The converter:
Make sure to actually change the current item in some way or it is quite pointless. Also the
ItemsSource
of theItemsControl
obviously needs to be a ICollectionView but you said that is the case anyway.