Currently in my Silverlight app I'm polling the database for changes to cached objects and am looking for advice on how to update the views that are displaying these lists.

Example: I have a static class that has lists of objects (Areas, vehicles drivers etc.) that I will be using throughout the application. I have a timer in my shell that will poll the database passing a timestamp of the last update. So if the timestamp has changed the updates will be passed back and the lists will be updated.

How do I update the views that will be displaying these lists. If the user is editing a record that displays a combobox bound to this list how will this data be updated and if the user has made a selection from the list will this affect the selection?

Bear in mind that some users will be adding to these lists that I will be inserting to the database.

Am I going about this in the right way?, or has anybody implemented this with success in their application?

2 Answers 2


Using a polling technique combined with Timestamp version test could lead to performance problems in cases with lot of connected clients (>50). If you have a limited number of clients, polling provides a cheap way to do it. In any case, you should always validate the data supplied by the user to ensure that it’s correct. In other words, if the user A deletes an entity and another user B uses the same entity, a validation should through an exception stating that entity is no longer exists.

  • Good point Chris - As for not using the polling technique combined with timestamp when there would be a lot of clients connecting. Can you advise on a better way of acheiving this?
    – paul
    Mar 5, 2012 at 17:10
  • Depends on the architecture of the application. For example, on WCF service scenarios, if it's possible to use duplex communication, the server could notify the client when an entity changes. Mar 5, 2012 at 19:56

You can start by storing the lists in ObserableCollection objects (or one of thew other collection objects designed to notify changes to views) and bind controls in your views to those.

ObservableCollection generate change events when the contents of the list change (additions, deletions etc).

  • So if I store the data in the ObservableCollection and update that collection on a background thread (additions, updates etc) would they be automatically updated on the views or do I have to subscribe to the collectionchanged event of the collection and update the list in the views accordingly?
    – paul
    Mar 5, 2012 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.