I have an array that populates a ListBox in my app. At first I need to set the foreground of each listboxItem to gray, and that's easy enough through Binding the foreground color to the listboxItem.
The problem comes in where I then have to seperately (based other back end factors) set specific listboxItems foreground to black. The trick being to select a specific item on the already populated listbox and re-set the foreground without having to re-render the entire listbox.
The objects that I bind to the listbox each does have a guid/unique-id. So if I could just select the item on the listbox ('where id=1635135;?), and then set that items foreground to black..
It's quite difficult to explain this a bit more clearly, but if you have any questions please ask! Thanks!
If you implement the INotifyPropertyChanged
in your ViewModel, just change the Foreground property to black for the items you want and they will automaticaly change from gray to black in your UI.