In Silverlight, I have a Grid with DataContext set to class ViewModel.
The ViewModel contains list of items (each of them containing int ID and string Text) and an integer "ID", which identifies the currently active item (not selected item).
I would like to construct xaml with ListBox where activated item has another color. How can I do it?
Specifically, in xaml, I have:
<Grid DataContext="ModelView">
<ListBox ItemsSource="Questions">
<ListBox.ItemTemplate>
<TextBlock Text="{Binding ID}" />
<TextBlock Text="{Binding Text}" />
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Text="{Binding ID}" />
</Grid>`
How can set I the color of one (and only one) item in the listbox, based on property ID in ModelView?
One more problem - when I change active item - how can I refresh the ListBox?