From 34d79871dd8eadb49f2fbffc15852c0fc2dd7ff5 Mon Sep 17 00:00:00 2001 From: XuShanQiXun <3401460572@qq.com> Date: Sat, 7 Jun 2025 01:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20`App.xaml`=20=E4=BB=A5?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20`MaterialDesignColors`=20=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E6=94=AF=E6=8C=81=EF=BC=8C=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=AD=97=E5=85=B8=E7=BB=93=E6=9E=84=E3=80=82?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20`chatapi.cs`=20=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=20`ChatData`=20=E7=B1=BB=E4=B8=BA=20`ChatRegisterData`?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E6=96=B0=E5=A2=9E=20`ChatData`=20=E7=B1=BB?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E8=81=8A=E5=A4=A9=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E3=80=82=E5=9C=A8=20`MainWindow.xaml`=20?= =?UTF-8?q?=E4=B8=AD=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=B9=B6=E9=87=8D=E6=9E=84=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B8=83=E5=B1=80=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20`Grid`=20=E4=BB=A5=E6=94=B9=E5=96=84=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E3=80=82=E4=BF=AE=E6=94=B9=20`MainWindow.xam?= =?UTF-8?q?l.cs`=20=E4=BB=A5=E9=80=82=E5=BA=94=E6=96=B0=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84=EF=BC=8C=E5=B9=B6=E5=9C=A8=20`chatc?= =?UTF-8?q?lient.csproj`=20=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=9B=BE=E6=A0=87=E5=8F=8A=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=B7=AF=E5=BE=84=E3=80=82=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20`chat.ico`=20=E4=BD=9C=E4=B8=BA=E5=BA=94=E7=94=A8=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=9B=BE=E6=A0=87=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatclient/App.xaml | 28 ++++++------- chatclient/Data/chatapi.cs | 11 ++++- chatclient/MainWindow.xaml | 75 +++++++++++++++++++++++++--------- chatclient/MainWindow.xaml.cs | 68 ++++++++++++++++++++---------- chatclient/chatclient.csproj | 16 +++++++- chatclient/resource/chat.ico | Bin 0 -> 88878 bytes 6 files changed, 139 insertions(+), 59 deletions(-) create mode 100644 chatclient/resource/chat.ico diff --git a/chatclient/App.xaml b/chatclient/App.xaml index 76fd1be..234aed7 100644 --- a/chatclient/App.xaml +++ b/chatclient/App.xaml @@ -1,18 +1,18 @@  - - - - - - - + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:chatclient" + StartupUri="MainWindow.xaml"> + + + + + + + - - + + diff --git a/chatclient/Data/chatapi.cs b/chatclient/Data/chatapi.cs index 2e0c7d2..720508d 100644 --- a/chatclient/Data/chatapi.cs +++ b/chatclient/Data/chatapi.cs @@ -1,4 +1,6 @@ -namespace chatclient.Data +using System.Security.RightsManagement; + +namespace chatclient.Data { internal class Server { @@ -32,11 +34,16 @@ { public string? type { get; set; } } - internal class ChatData + internal class ChatRegisterData { public string? user { get; set; } = "Unnamed"; public string? message { get; set; } = null; public string? image { get; set; } = null; public DateTime timestamp { get; set; } = DateTime.Now; } + internal class ChatData + { + public required string type { get; set; } = "chat"; + public required string message { get; set; } = "message"; + } } diff --git a/chatclient/MainWindow.xaml b/chatclient/MainWindow.xaml index 18a8066..258ffb7 100644 --- a/chatclient/MainWindow.xaml +++ b/chatclient/MainWindow.xaml @@ -1,10 +1,11 @@ - @@ -14,7 +15,7 @@ @@ -54,39 +55,73 @@ + Padding="10" Background="{DynamicResource MaterialDesignPaper}"> - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + TextWrapping="Wrap" MinHeight="60" MaxHeight="120" Margin="5"/>