Jeremy S Brown

Professional Learner with a Passion for Writing Software

Powered by Genesis

Note To Self: Async Calls in Property Setter

June 1, 2014 by Jeremy Leave a Comment

Recently came across a need to make an async call within a property’s setter. Ok no big deal I’ll just add “async” to the property and use await. Unfortunately this is no allowed, but after a little research I found there is a way to make this happen and thankfully it’s just a line of code. Within the property setter logic do the following:

Deployment.Current.Dispatcher.InvokeAsync(async () => await MyMethodCallAsync());

Filed Under: Note To Self

Leave a Reply Cancel reply

You must be logged in to post a comment.