Silverlight authentication during startup - how to mimic syncronous behavior?

Posted by jkohlhepp on Stack Overflow See other posts from Stack Overflow or by jkohlhepp
Published on 2011-01-06T13:50:11Z Indexed on 2011/01/06 13:53 UTC
Read the original article Hit count: 410

I have a Silverlight app that is using the MVVM pattern. I have a WCF service which will allow me to authenticate users (I don't have direct control over that service - assume it is a black box that just returns me the user info and a list of privileges the user has). So, when the app starts up, I want to pull security data from that service.

Right now, when I do this, my views and view models can end up getting initialized before the service returns with the security data. This causes problems because the view models need to disable buttons and make things visible/invisible based on the user having certain privileges.

Is there a pattern that allows me to prevent the initialization of the views / view models until the WCF call has returned? How would you go about solving this problem as elegantly as possible?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about silverlight-4.0