CollabVMDesktopClient/CollabVMClient/ViewModels/CollabVMChatViewModel.cs

36 lines
1,019 B
C#
Raw Normal View History

2023-08-29 08:52:35 -04:00
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;
}
}
}