I’m working on a Windows 8 app. While the app is running, I’m trying to determine when a user’s internet connectivity is restored. In an attempt to do this, I’m listening to the NetworkChange_NetworkAddressChanged event. When that event is fired, I try to update my UI and execute my query to my web service via a method called GetLatestData. When I attempt to call this method from within the NetworkChange_NetworkAddressChanged event, I currently get an error that says:
The application called an interface that was marshalled for a different thread.
How do I overcome this error to update my UI and hit a web service from the NetworkChange_NetworkAddressChanged event?
Sample above calls (marshals) Update function using UI thread.