async void SharedManager_ApplicationContextUpdated(WatchConnectivity.WCSession session, System.Collections.Generic.Dictionary <string, object> applicationContext) { Console.WriteLine("SharedManager_ApplicationContextUpdated..."); var message = (string)applicationContext ["MessagePhone"]; if (message != null) { //do somethign with message Console.WriteLine("SharedManager_ApplicationContextUpdated: " + message); var coordinates = message.Split(",".ToCharArray()); Util.destination = new Model.Location() { Lat = coordinates [0], Lon = coordinates [1] }; InvokeOnMainThread(() => { lblDestination.SetText(string.Format("To: {0},{1}", Util.destination.Lat, Util.destination.Lon)); }); var json = await Util.TimeEstimates(Util.start); InvokeOnMainThread(() => { PushController("EstimatesController", json); }); } }
// Receiving data from Watch void SharedManager_ApplicationContextUpdated(WatchConnectivity.WCSession session, System.Collections.Generic.Dictionary <string, object> applicationContext) { var message = (string)applicationContext ["MessageWatch"]; if (message != null) { Console.WriteLine($"Application context update received: {message}"); InvokeOnMainThread(() => { //Update UI }); } }