Quantcast
Viewing all articles
Browse latest Browse all 12

LongListSelector nullexception gotcha

Just had a little puzzler with my Windows Phone 7 application. My application uses the LongListSelector which is bound to a view model. However, if I launch a second page that will add extra data to the model and return back the LongListSelector kept throwing a nullexception error. It would appear the the LongSelector does not like receiving an OnPropertyChanged whilst on a page that is not currently showing. To workaround the problem I’ve had to expose a ‘Refresh’ method on my view model that the page invokes when it redisplays. I dare say it’s something I’ve not understood correctly about the page life cycle, so I thought I’d share it to a) help someone else with the same problem b) hope someone helps me with a better solution


Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 12

Trending Articles