diff --git a/stormchat-client-csharp/StormChatWPF/App.xaml b/stormchat-client-csharp/StormChatWPF/App.xaml
index 1fc1979..c42445d 100644
--- a/stormchat-client-csharp/StormChatWPF/App.xaml
+++ b/stormchat-client-csharp/StormChatWPF/App.xaml
@@ -4,6 +4,10 @@
xmlns:local="clr-namespace:StormChatWPF"
StartupUri="LogWindow.xaml">
-
+
+
+
+
+
diff --git a/stormchat-client-csharp/StormChatWPF/Chat.cs b/stormchat-client-csharp/StormChatWPF/Chat.cs
index 28a6405..a756a8c 100644
--- a/stormchat-client-csharp/StormChatWPF/Chat.cs
+++ b/stormchat-client-csharp/StormChatWPF/Chat.cs
@@ -62,7 +62,7 @@ namespace StormChatWPF
{
if (MainWindow.Instence != null)
{
- MainWindow.Instence.ShowMessage(message);
+ MainWindow.Instence.UI_ShowMessage(message);
}
}//接受到新消息
@@ -71,7 +71,7 @@ namespace StormChatWPF
Message msg = new Message(text,target);
Action f = delegate (ResultHead head)
{
- MainWindow.Instence.ShowMessage(msg);
+ MainWindow.Instence.UI_ShowMessage(msg);
};
StormClient.QueueSendMessage(msg,f);
}//发送消息
diff --git a/stormchat-client-csharp/StormChatWPF/LogWindow.xaml b/stormchat-client-csharp/StormChatWPF/LogWindow.xaml
index 86d517f..6f4d64c 100644
--- a/stormchat-client-csharp/StormChatWPF/LogWindow.xaml
+++ b/stormchat-client-csharp/StormChatWPF/LogWindow.xaml
@@ -21,7 +21,7 @@
-
+
diff --git a/stormchat-client-csharp/StormChatWPF/MainWindow.xaml b/stormchat-client-csharp/StormChatWPF/MainWindow.xaml
index fbe4b5b..421f3dd 100644
--- a/stormchat-client-csharp/StormChatWPF/MainWindow.xaml
+++ b/stormchat-client-csharp/StormChatWPF/MainWindow.xaml
@@ -6,30 +6,42 @@
xmlns:local="clr-namespace:StormChatWPF"
xmlns:my="clr-namespace:StormChatWPF.UI"
mc:Ignorable="d"
- Title="StormChat" Height="450" Width="800"
- WindowStartupLocation="CenterScreen">
-
+ Title="StormChat" Height="600" Width="850"
+ WindowStartupLocation="CenterScreen"
+ Icon="UI/Resources/闪电.png">
+
-
+
-
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/stormchat-client-csharp/StormChatWPF/MainWindow.xaml.cs b/stormchat-client-csharp/StormChatWPF/MainWindow.xaml.cs
index 47d66cd..a86f909 100644
--- a/stormchat-client-csharp/StormChatWPF/MainWindow.xaml.cs
+++ b/stormchat-client-csharp/StormChatWPF/MainWindow.xaml.cs
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
using System.Windows.Media.Imaging;
namespace StormChatWPF
@@ -25,10 +26,10 @@ namespace StormChatWPF
}
void Window_Load(object sender, EventArgs e)
{
- LoadContactsList();
- LoadUserMe();
+ UI_LoadContactsList();
+ UI_LoadUserMe();
}
- private void LoadUserMe()
+ private void UI_LoadUserMe()
{
BitmapImage image = new BitmapImage();
image.BeginInit();
@@ -38,9 +39,32 @@ namespace StormChatWPF
User_HeadPicture.Source = image;
User_NickNmae.Content = User.Me.NickName;
User_motto.Content = User.Me.Motto;
- }
+ }//加载用当前用户UI显示信息
+ private void UI_LoadSettings()
+ {
- private void LoadContactsList()
+ }
+ internal void UI_ShowMessage(Message message)
+ {
+ if (message.To == User.Me)
+ {
+ App.Current.Dispatcher.Invoke(
+ (Action)delegate ()
+ {
+ OutBox.Children.Add(new StormChatWPF.UI.ChatBubble(message, HorizontalAlignment.Left));
+ });
+ }//接受到的的消息
+ else
+ {
+ App.Current.Dispatcher.Invoke(
+ (Action)delegate ()
+ {
+ OutBox.Children.Add(new StormChatWPF.UI.ChatBubble(message, HorizontalAlignment.Right));
+ });
+ }//发送的的消息
+ }//将消息展现于UI界面
+
+ private void UI_LoadContactsList()
{
if (Chat.ContactsList.Any())
{
@@ -79,25 +103,7 @@ namespace StormChatWPF
}
}
- internal void ShowMessage(Message message)
- {
- if (message.To == User.Me)
- {
- App.Current.Dispatcher.Invoke(
- (Action)delegate ()
- {
- OutBox.Children.Add(new StormChatWPF.UI.ChatBubble(message, HorizontalAlignment.Left));
- });
- }//接受到的的消息
- else
- {
- App.Current.Dispatcher.Invoke(
- (Action)delegate ()
- {
- OutBox.Children.Add(new StormChatWPF.UI.ChatBubble(message, HorizontalAlignment.Right));
- });
- }//发送的的消息
- }//将消息展现于UI界面
+
private void button_Click_1(object sender, RoutedEventArgs e)
{
@@ -108,5 +114,25 @@ namespace StormChatWPF
}
event LoadFinish MainWindowLoad;
+
+ private void MenuItem_Settings_Click(object sender, RoutedEventArgs e)
+ {
+ MessageBox.Show("Settings");
+ }
+
+ private void Menu_Initialized(object sender, EventArgs e)
+ {
+ this.image.ContextMenu = null;
+ }
+
+ private void Menu_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+
+ this.Menu.PlacementTarget = this.image;
+ //位置
+ this.Menu.Placement = PlacementMode.Top;
+ //显示菜单
+ this.Menu.IsOpen = true;
+ }
}
}
diff --git a/stormchat-client-csharp/StormChatWPF/Simple Styles.xaml b/stormchat-client-csharp/StormChatWPF/Simple Styles.xaml
new file mode 100644
index 0000000..833c2fc
--- /dev/null
+++ b/stormchat-client-csharp/StormChatWPF/Simple Styles.xaml
@@ -0,0 +1,1121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/stormchat-client-csharp/StormChatWPF/StormChatWPF.csproj b/stormchat-client-csharp/StormChatWPF/StormChatWPF.csproj
index 22097bf..fe3d354 100644
--- a/stormchat-client-csharp/StormChatWPF/StormChatWPF.csproj
+++ b/stormchat-client-csharp/StormChatWPF/StormChatWPF.csproj
@@ -70,8 +70,8 @@
Contacts.xaml
-
- UserMeHeadInfo.xaml
+
+ DropDownMenu.xaml
Window1.xaml
@@ -96,7 +96,11 @@
Designer
MSBuild:Compile
-
+
+ Designer
+ MSBuild:Compile
+
+
Designer
MSBuild:Compile
diff --git a/stormchat-client-csharp/StormChatWPF/UI/UserMeHeadInfo.xaml b/stormchat-client-csharp/StormChatWPF/UI/DropDownMenu.xaml
similarity index 55%
rename from stormchat-client-csharp/StormChatWPF/UI/UserMeHeadInfo.xaml
rename to stormchat-client-csharp/StormChatWPF/UI/DropDownMenu.xaml
index b0e8217..ae9eac8 100644
--- a/stormchat-client-csharp/StormChatWPF/UI/UserMeHeadInfo.xaml
+++ b/stormchat-client-csharp/StormChatWPF/UI/DropDownMenu.xaml
@@ -1,17 +1,13 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/stormchat-client-csharp/StormChatWPF/UI/UserMeHeadInfo.xaml.cs b/stormchat-client-csharp/StormChatWPF/UI/DropDownMenu.xaml.cs
similarity index 75%
rename from stormchat-client-csharp/StormChatWPF/UI/UserMeHeadInfo.xaml.cs
rename to stormchat-client-csharp/StormChatWPF/UI/DropDownMenu.xaml.cs
index 533a0b7..e6db64d 100644
--- a/stormchat-client-csharp/StormChatWPF/UI/UserMeHeadInfo.xaml.cs
+++ b/stormchat-client-csharp/StormChatWPF/UI/DropDownMenu.xaml.cs
@@ -1,27 +1,27 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace StormChatWPF.UI
-{
- ///
- /// UserMeHeadInfo.xaml 的交互逻辑
- ///
- public partial class UserMeHeadInfo : UserControl
- {
- public UserMeHeadInfo()
- {
- InitializeComponent();
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace StormChatWPF.UI
+{
+ ///
+ /// DropDownMenu.xaml 的交互逻辑
+ ///
+ public partial class DropDownMenu : UserControl
+ {
+ public DropDownMenu()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/stormchat-client-csharp/StormChatWPF/UI/Style.xaml b/stormchat-client-csharp/StormChatWPF/UI/Style.xaml
new file mode 100644
index 0000000..9169772
--- /dev/null
+++ b/stormchat-client-csharp/StormChatWPF/UI/Style.xaml
@@ -0,0 +1,16 @@
+
+
+
\ No newline at end of file
diff --git a/stormchat-client-csharp/StormChatWPF/Window1.xaml b/stormchat-client-csharp/StormChatWPF/Window1.xaml
index d8cbabf..c81e8a2 100644
--- a/stormchat-client-csharp/StormChatWPF/Window1.xaml
+++ b/stormchat-client-csharp/StormChatWPF/Window1.xaml
@@ -7,11 +7,6 @@
mc:Ignorable="d"
Title="Window1" Height="300" Width="300">
-
-
-
-
-
-
+
diff --git a/stormchat-client-csharp/StormChatWPF/Window1.xaml.cs b/stormchat-client-csharp/StormChatWPF/Window1.xaml.cs
index 8bcf603..3133929 100644
--- a/stormchat-client-csharp/StormChatWPF/Window1.xaml.cs
+++ b/stormchat-client-csharp/StormChatWPF/Window1.xaml.cs
@@ -26,11 +26,6 @@ namespace StormChatWPF
private void Button_Click(object sender, RoutedEventArgs e)
{
- image.Source = new BitmapImage()
- {
- StreamSource = new FileStream(@"C:\Users\10568\Source\Repos\stormchat\stormchat-client-csharp\StormChatWPF\UI\Resources\闪电.png", FileMode.Open)
-
- };
}
}
}