//The code below is for sending messages public async Task <string> SendMessage(string message, int recId) { if (!string.IsNullOrWhiteSpace(message)) { var result = await _messagesProxy.PostMessage(new Messages { ReceiverId = recId, SenderId = MainPage.user.Id, Msg = message }); return(result); } return(null); }
private async void btnSendMsg_Clicked(object sender, EventArgs e) { if (!String.IsNullOrEmpty(txtMsg.Text)) { string response = await _messageProxy.PostMessage(new Messages { ReceiverId = msgMod.SenderId, SenderId = msgMod.ReceiverId, Msg = txtMsg.Text }); await DisplayAlert("Reply Sent", response, "Ok"); MsgStack.IsVisible = true; ReplyStack.IsVisible = false; lstMsg.SelectedItem = null; txtMsg.Text = String.Empty; } }