I have a Silverlight 3 application which calls a traditional .NET Web Service (asmx) to get a list of records and then display it in a ListBox control (lstRecords.ItemsSource = myRecords). Any records could be added or updated or deleted at anytime and I would like my UI (records displayed in the ListBox control) to reflect the latest change.
Right now, I have a System.Threading.Timer which calls every 5 seconds the WebService and update the lstRecords.ItemsSource. It sort of works, but it doesn't do exactly what I want. For instance, if a row is selected and the ItemsSource refreshed, I lose the selection.
I was wondering if there is a mechanism in Silverlight 3 to handle such thing. Do you have better suggestion on how I could accomplish that?
Thanks!