I couldn't find a solution for my problem/idea, and I hope that someone could help me out.
In WPF I have a `CollectionViewSource` depending on an `IEnumerable<Item>`.
An `Item` has the *Name*, *Height*, *Age* fields.
In Xaml, the ListView's `ItemsSource="{Binding CollectionViewSource.View}"`.

I know, the `Listview` has an `AlternationCount` property which can change the row background color.

But I want to change the row background color only if the *Age* field data is different from the above row's *Age* data.

Like this, ordered by *Age*:

![alternate](https://i.stack.imgur.com/AMAgo.jpg)

The row background color is alternated only when the *Age* data is different.

When I set another sort order to the list, the alternating should also be changed.

In this picture the list is ordered by *Name*:

![Alternate color order name](https://i.stack.imgur.com/n6o48.jpg)

But the background color depends on the *Age* data.

Is there any way to make a solution for this concept?