public async Task<bool> Update(Message message) { IHubProxy hubProxy = await DBConnection.GetProxy(hubName); return await hubProxy.Invoke<bool>("Update", message); }
private async void SendMessage() { int conversationIndex = ConversationListView.SelectedIndex; if (conversationIndex == -1) { ErrorLabel.Content = "You have to select a conversation before sending a message"; } else { Conversation conversation = _conversationCollection[conversationIndex]; var newMessage = new Message { Sender = ActiveUser, Content = MessageTextBox.Text, Conversation = conversation, TimeSent = DateTime.Now }; await _messageDao.Add(newMessage); //ConversationListView.InvalidateVisual(); this.UpdateLayout(); MessageTextBox.Clear(); } }