wpf, dataGrid, multivalue converter: how to get the current row selected in extended selection mode?
===

I have a dataGrid with the slection mode in extended, so I can select many rows.

I have a style trigger, with a multivalue converter, to set the background color of the row according to some conditions.

Well, in my probes, I pass three parameter,s ItemsSource, SelectedItems and selectedItem. I notice the following behavior:

When I select the first row, ItemsSource has all the rows of the dataGrid. This is correct. SelectedItems has 0 items and selectedItem is null. However, without do nothing, the code enter by second time in the converter, in this case SelectedItem is the item selected in the dataGrid, but SelectedItems has no items.

When I select the second row, SelectedItems has one item, the first selected row of the dataGrid, and selectedItem has the first row too. In this case the code does not enter by second time in the converter.

When I select the third row, SelectedItems has two items, the first and the second row selected, but not the third. SelectedItem has the first row selected.

So I see that SelectedItem alway has the first row selected and SelectedItems has the n-1 selected rows.

But how can I know what is the current selected row? the new row?



Thanks.