diff --git a/DoctorApp/ViewModels/ClientInfoViewModel.cs b/DoctorApp/ViewModels/ClientInfoViewModel.cs index 7cda6a4..9e64e9c 100644 --- a/DoctorApp/ViewModels/ClientInfoViewModel.cs +++ b/DoctorApp/ViewModels/ClientInfoViewModel.cs @@ -68,12 +68,17 @@ namespace DoctorApp.ViewModels Chat = new RelayCommand((parameter) => { - client.sendMessage(DataParser.getChatJson(PatientInfo.Username, ((TextBox)parameter).Text)); - PatientInfo.ChatLog.Add(DateTime.Now + ": " + ((TextBox)parameter).Text); + SendMessageToClient(PatientInfo.Username, ((TextBox)parameter).Text); }); //TODO RelayCommand ChatToAll + ChatToAll = new RelayCommand((parameter) => + { + //todo save clientinfoviewmodels in mainviewmodel + //todo send message to client of every clientinfoviewmodel + }); + SetResistance = new RelayCommand((parameter) => { 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) { //TODO