ADD] added message sending to all clients, doesn't work yet
This commit is contained in:
Sem van der Hoeven
2020-10-27 21:24:47 +01:00
parent fab3ed7705
commit cda8b47ca3
5 changed files with 18 additions and 7 deletions

View File

@@ -43,12 +43,14 @@ namespace DoctorApp.ViewModels
public MainWindowViewModel MainWindowViewModel { get; set; }
private Client client;
private MainViewModel parent;
public Chart Chart { get; set; }
public ClientInfoViewModel(MainWindowViewModel mainWindowViewModel, string username)
public ClientInfoViewModel(MainViewModel parent,MainWindowViewModel mainWindowViewModel, string username)
{
MainWindowViewModel = mainWindowViewModel;
this.parent = parent;
this.PatientInfo = new PatientInfo() { Username = username, Status = "Waiting to start" };
this.Chart = new Chart(this.PatientInfo);
PatientInfo.ChatLog = new ObservableCollection<string>();
@@ -75,8 +77,7 @@ namespace DoctorApp.ViewModels
ChatToAll = new RelayCommand<object>((parameter) =>
{
//todo save clientinfoviewmodels in mainviewmodel
//todo send message to client of every clientinfoviewmodel
this.parent?.SendToAllClients(((TextBox)parameter).Text);
});
SetResistance = new RelayCommand<object>((parameter) =>