I have a WPF app that dynamically adds and removes tabs with list views as the content. I want to change the background color of a row in the list view based on the content of one of the columns in the row.
All of the solutions I have seen require using styles in XAML, which is incompatible with my current setup since the list views are created entirely in C# at runtime.
I have tried creating styles and adding data triggers and setters, but it doesn't seem to change anything. There are also multiple list views that should have different styles, so I'm not sure that changing the default style of all list views would be appropriate.
The content of the list view looks like this, and the WAR messages should have a yellow background:
Per the comment from @lidqy, the solution to this was to change
to
The Style declaration line also needed to be changed from
to
since ItemContainerStyle is apparently a style applied to ListViewItem (not ListView).