Connections shit

This commit is contained in:
fabjuuuh
2020-10-14 13:05:56 +02:00
parent 301f6b447f
commit 25176dbaeb
13 changed files with 186 additions and 34 deletions

View File

@@ -1,12 +1,17 @@
using DoctorApp.Utils;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;
using System.Windows.Controls;
namespace DoctorApp.ViewModels
{
class MainViewModel : ObservableObject
{
public ObservableCollection<object> Tabs { get; set; }
public int Selected { get; set; }
public MainWindowViewModel MainWindowViewModel { get; set; }
Client client;
@@ -15,6 +20,26 @@ namespace DoctorApp.ViewModels
{
this.MainWindowViewModel = mainWindowViewModel;
client = this.MainWindowViewModel.client;
Tabs= new ObservableCollection<object>();
}
public void NewConnectedUser(string username)
{
App.Current.Dispatcher.Invoke((Action)delegate
{
Tabs.Add(new ClientInfoViewModel
{
Username = username,
TabName = username
});
});
}
public void DisconnectedUser(string username)
{
}
}
}