Example #1
0
        private async void OnBeaconFound(object sender, BeaconModel beaconModel)
        {
            try
            {
                var place = await PlaceService.GetPlaceByBeaconAsync(beaconModel);

                if (place != null)
                {
                    if (!_feedbackWasShown)
                    {
                        _feedbackWasShown = true;
                        ShowViewModel <FeedbackViewModel>(new { id = place.Id, name = place.Name });
                    }
                    else
                    {
                        Mvx.Resolve <IMvxMessenger>().Publish(new BeaconFoundMessage(this, place.Id, place.Name));
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine($"{ex}\n{beaconModel.ToString()}");
            }
        }