[EDIT] made seperate method for sending message

This commit is contained in:
Sem van der Hoeven
2020-10-27 20:59:46 +01:00
parent aeb5d59ce9
commit fab3ed7705

View File

@@ -68,12 +68,17 @@ namespace DoctorApp.ViewModels
Chat = new RelayCommand<object>((parameter) => Chat = new RelayCommand<object>((parameter) =>
{ {
client.sendMessage(DataParser.getChatJson(PatientInfo.Username, ((TextBox)parameter).Text)); SendMessageToClient(PatientInfo.Username, ((TextBox)parameter).Text);
PatientInfo.ChatLog.Add(DateTime.Now + ": " + ((TextBox)parameter).Text);
}); });
//TODO RelayCommand ChatToAll //TODO RelayCommand ChatToAll
ChatToAll = new RelayCommand<object>((parameter) =>
{
//todo save clientinfoviewmodels in mainviewmodel
//todo send message to client of every clientinfoviewmodel
});
SetResistance = new RelayCommand<object>((parameter) => SetResistance = new RelayCommand<object>((parameter) =>
{ {
Debug.WriteLine("resistance"); Debug.WriteLine("resistance");
@@ -83,6 +88,12 @@ namespace DoctorApp.ViewModels
} }
public void SendMessageToClient(string username, string text)
{
client.sendMessage(DataParser.getChatJson(username, text));
PatientInfo.ChatLog.Add(DateTime.Now + ": " + text);
}
public void BPMData(byte [] bytes) public void BPMData(byte [] bytes)
{ {
//TODO //TODO