36 lines
1,019 B
C#
36 lines
1,019 B
C#
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Collections.ObjectModel;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace CollabVMClient.ViewModels
|
|||
|
{
|
|||
|
internal partial class CollabVMChatViewModel : ViewModelBase
|
|||
|
{
|
|||
|
public ObservableCollection<ChatMessageViewModel> ChatMessages { get; } = new ObservableCollection<ChatMessageViewModel>();
|
|||
|
[ObservableProperty] private string username;
|
|||
|
[ObservableProperty] private string id;
|
|||
|
public string Title => $"CollabVM - Chat ({id})";
|
|||
|
|
|||
|
|
|||
|
public void AddChatMessage(string username, string message)
|
|||
|
{
|
|||
|
ChatMessages.Add(new ChatMessageViewModel(username, message));
|
|||
|
}
|
|||
|
|
|||
|
public CollabVMChatViewModel(string id)
|
|||
|
{
|
|||
|
this.Username = "username";
|
|||
|
this.Id = id;
|
|||
|
}
|
|||
|
|
|||
|
public void SetUsername(string username)
|
|||
|
{
|
|||
|
this.Username = username;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|