bare basic WS setup

This commit is contained in:
2026-03-20 23:59:08 -04:00
parent 4961ced384
commit 2b2b16271b
5 changed files with 36 additions and 12 deletions

View File

@@ -16,24 +16,27 @@ public partial class MainPage : ContentPage
private void SendButton_OnClicked(object? sender, EventArgs e)
{
SendMessage();
SendMessage(sender, e);
}
private void MessageEntry_OnCompleted(object? sender, EventArgs e)
{
SendMessage();
SendMessage(sender, e);
}
private void SendMessage()
private void SendMessage(object? sender, EventArgs e)
{
var text = MessageEntry.Text?.Trim();
if (string.IsNullOrWhiteSpace(text))
return;
MauiProgram.wsc.Send($"{_username}:{text}");
ChatSimulator.Send(_username, text);
// ChatSimulator.Send(_username, text);
Console.WriteLine($"[{_username}] sent message: {text}");
MessageEntry.Text = string.Empty;
MessageEntry.Focus();