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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
ItemsSourceof theItemsControlobviously needs to be a ICollectionView but you said that is the case anyway.