views:

22

answers:

1

I am displaying a list of recently processed items in a Silverlight DataGrid. I really want to add a highlighting animation for newly added rows so that users would immediately notice that something did happen in the application.

How can I trigger my Sotryboard so it is played when new item is added to the ObservableCollection backing the DataGrid?

A: 

Catch OnLoadingRow, OnLoadingRowDetails, OnLoadingRowGroup events, there you can prepare and style the actually loaded row. The eventargument is Row, type of DataGridRow, which is inherited from Control.

mohojojo
OnLoadingRow is fired every time DataGrid wants to refresh itself. There is no easy way (I can't find one) to differentiate newly added rows from ones that were already there.
Szymon Pobiega
The newly added rows DataContext is equals to the new ObservableCollection element. Keep a reference to this element and check equality in OnloadingRow event.
mohojojo