diff --git a/chatclient/Data/ChatDataModel.cs b/chatclient/Data/ChatDataModel.cs index 27b02d2..255987a 100644 --- a/chatclient/Data/ChatDataModel.cs +++ b/chatclient/Data/ChatDataModel.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using System.Windows.Media; using System.Windows; using System.Windows.Media.Imaging; +using System.Windows.Controls; +using System.Windows.Input; namespace chatclient.Data { @@ -21,7 +23,7 @@ namespace chatclient.Data /// /// 消息类型(文本、图片、文件、系统消息等) /// - public required MessageType Type { get; set; } = MessageType.Text; + public required MessageType MsgType { get; set; } = MessageType.Text; /// /// 消息发送者的头像图片 /// diff --git a/chatclient/Data/TrayIconManager.cs b/chatclient/Data/TrayIconManager.cs index b4207c7..a0c34ca 100644 --- a/chatclient/Data/TrayIconManager.cs +++ b/chatclient/Data/TrayIconManager.cs @@ -51,13 +51,13 @@ namespace chatclient.Data }; // 添加菜单项 - contextMenu.Items.Add(CreateMenuItem("Open Application", PackIconKind.WindowRestore, OpenApp_Click)); - contextMenu.Items.Add(CreateMenuItem("Settings", PackIconKind.Cog, Settings_Click)); + contextMenu.Items.Add(CreateMenuItem("打开程序", PackIconKind.WindowRestore, OpenApp_Click)); + contextMenu.Items.Add(CreateMenuItem("设置", PackIconKind.Cog, Settings_Click)); contextMenu.Items.Add(new Separator { Style = (Style)Application.Current.Resources["MaterialDesignLightSeparator"] }); - contextMenu.Items.Add(CreateMenuItem("Check for Updates", PackIconKind.Update, Updates_Click)); - contextMenu.Items.Add(CreateMenuItem("Help", PackIconKind.HelpCircle, Help_Click)); - contextMenu.Items.Add(new Separator { Style = (Style)Application.Current.Resources["MaterialDesignLightSeparator"] }); - contextMenu.Items.Add(CreateMenuItem("Exit", PackIconKind.Power, Exit_Click)); + //contextMenu.Items.Add(CreateMenuItem("Check for Updates", PackIconKind.Update, Updates_Click)); + //contextMenu.Items.Add(CreateMenuItem("Help", PackIconKind.HelpCircle, Help_Click)); + //contextMenu.Items.Add(new Separator { Style = (Style)Application.Current.Resources["MaterialDesignLightSeparator"] }); + contextMenu.Items.Add(CreateMenuItem("退出", PackIconKind.Power, Exit_Click)); return contextMenu; } @@ -109,7 +109,6 @@ namespace chatclient.Data private void Exit_Click(object sender, RoutedEventArgs e) { - // 释放托盘图标资源 Dispose(); Application.Current.Shutdown(); } diff --git a/chatclient/LoginWindow.xaml b/chatclient/LoginWindow.xaml index eeaa12e..61fab8c 100644 --- a/chatclient/LoginWindow.xaml +++ b/chatclient/LoginWindow.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:chatclient" xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" x:Class="chatclient.LoginWindow" mc:Ignorable="d" - Title="LoginWindow" Height="590" Width="360" MinHeight="590" MinWidth="360" MaxHeight="590" MaxWidth="360" + Title="LoginWindow" Height="590" Width="330" MinHeight="590" MinWidth="330" MaxHeight="590" MaxWidth="330" ResizeMode="NoResize" Closing="Window_Closing"> diff --git a/chatclient/MainWindow.xaml b/chatclient/MainWindow.xaml index af3ebf5..cce7b90 100644 --- a/chatclient/MainWindow.xaml +++ b/chatclient/MainWindow.xaml @@ -80,9 +80,9 @@ - - - + + + @@ -96,6 +96,12 @@ + + + + + + @@ -119,7 +125,7 @@ + TextWrapping="Wrap" MinHeight="50" MaxHeight="100" Margin="5" BorderBrush="#00000000" CaretBrush="#00673AB7" SelectionBrush="#00B39DDB"/>