public FeedBackViewModel() { AddFeedback = new AddFeedbackRequestModel(); BackCommand = new Command(BackCommandExcute); SubmitCommand = new Command(SubmitCommandExcute); if (Rg.Plugins.Popup.Services.PopupNavigation.Instance.PopupStack.Any()) { PopupNavigation.Instance.PopAsync(); } PageTitle = "FeedBack Page"; Analytics.TrackEvent("Page", new Dictionary <string, string> { { "Value", PageTitle } }); }
public async Task <AddFeedBcakResponseModel> AddFeedback(AddFeedbackRequestModel requestModel) { var client = new HttpClient(); var data = new AddFeedbackRequestModel { Name = requestModel.Name, Email = requestModel.Email, Feedback = requestModel.Feedback }; var jsonString = JsonConvert.SerializeObject(data); var requestContent = new StringContent(jsonString); var response = client.PostAsync(Helper.Constants.Feedback_Api_Key, requestContent).Result; System.Console.WriteLine(response.StatusCode); var result = response.Content.ReadAsStringAsync().Result; System.Console.WriteLine(result); var feedbackAdded = JsonConvert.DeserializeObject <AddFeedBcakResponseModel>(result); return(feedbackAdded); }