public Task<Tuple<bool, AVIMLocationMessage>> SendLocationMessageAsync(AVIMLocationMessage avLocationMessage)
 {
     return InternalExtensions.OnSuccess<Tuple<bool, AVIMTypedMessage>, Tuple<bool, AVIMLocationMessage>>(this.SendTypedMessageAsync((AVIMTypedMessage)avLocationMessage), (Func<Task<Tuple<bool, AVIMTypedMessage>>, Tuple<bool, AVIMLocationMessage>>)(x => new Tuple<bool, AVIMLocationMessage>(x.Result.Item1, avLocationMessage)));
 }
        private async void btn_sendLocation_Click(object sender, RoutedEventArgs e)
        {
            Geolocator geolocator = new Geolocator();
            geolocator.DesiredAccuracyInMeters = 50;

            try
            {
                Geoposition geoposition = await geolocator.GetGeopositionAsync(maximumAge: TimeSpan.FromMinutes(5), timeout: TimeSpan.FromSeconds(10));
                AVIMLocationMessage locationMessage = new AVIMLocationMessage(geoposition.Coordinate.Latitude, geoposition.Coordinate.Longitude);
                await conversation.SendLocationMessageAsync(locationMessage);
            }
            catch (Exception ex)
            {
                if ((uint)ex.HResult == 0x80004004)
                {

                    var error = "location  is disabled in phone settings.";
                }
            }
        }