private async void SendMessageCommand_Execute(string text)
        {
            var msg = new SocketBusiness.MessageModel()
            {
                Published = DateTime.Now,
                Sender    = LoginViewModel.MySelfUserName,
                Content   = text
            };
            await App.ClientSocket.SendMsg(msg);

            ChatRecordCollection.Add(msg);
        }
Exemple #2
0
 public async Task SendMsg(MessageModel msg, StreamSocket client = null)
 {
     client = client ?? Socket;
     await SendData(client, JsonConvert.SerializeObject(msg));
 }