private void OnLocationSelection(LocationSelectionResult result)
 {
     if (result.MessageId == Constants.Navigation.MainPage)
     {
         if (result.Result == TaskResult.Success)
         {
             Location = result.Location;
         }
     }
 }
 public void Closing()
 {
     if (!_selectionMade)
     {
         //NOTE: Always fire location selection event, so subscribers can unsubscribe
         var result = new LocationSelectionResult(TaskResult.Canceled)
         {
             MessageId = _sourceId
         };
         App.EventMessenger.GetEvent <LocationSelectionMessageEvent>().Publish(result);
     }
 }
        private async void SelectLocationAsync()
        {
            LocationSelectionResult result = new LocationSelectionResult(TaskResult.Success)
            {
                Location = Locations != null?Locations.FirstOrDefault() : null,
                               MessageId = _sourceId
            };

            if (result.Location == null)
            {
                App.ShowMessage("Please select a location", "make selection");
            }
            else
            {
                _selectionMade = true;
                App.EventMessenger.GetEvent <LocationSelectionMessageEvent>().Publish(result);

                await App.Current.MainPage.Navigation.PopAsync();
            }
        }