Philipp Schmid
Philipp Schmid

Reputation: 5828

Binding the Background color of an Item in the LongListSelector

In my Windows Phone 8 application I am using a LongListSelector to display grouped data. I would like to bind the background color of the item in the ItemTemplate to the SelectedItem using a value converter.

However, I cannot figure out how to access the selected item in the value converter to return the correct background color. What is the correct way to setup the coloring of the selected item in a LongListSelector?

Upvotes: 1

Views: 432

Answers (1)

gleb.kudr
gleb.kudr

Reputation: 1508

I prefer to convert value in code end pass the converted value to XAML.

You can access selected item data object by yourLongListSelector.SelectedItem.DataContext

Upvotes: 1

Related Questions