Connections shit
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user