完善登录窗口UI设计
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ namespace Interact
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
workingDictionary.Clear(); //清空临时记录
|
workingDictionary?.Clear(); //清空临时记录
|
||||||
if (sendLoopThread != null)
|
if (sendLoopThread != null)
|
||||||
sendLoopThread.Abort();
|
sendLoopThread.Abort();
|
||||||
if (readLoopThread != null)
|
if (readLoopThread != null)
|
||||||
|
|||||||
+6
-15
@@ -19,20 +19,8 @@ namespace StormChatWPF
|
|||||||
StormClient.OnGetUserListDone += GetContactsList;
|
StormClient.OnGetUserListDone += GetContactsList;
|
||||||
StormClient.OnMessage +=ReciveMessage;
|
StormClient.OnMessage +=ReciveMessage;
|
||||||
}
|
}
|
||||||
|
internal User SetContact { get; set; }//设置当前联系人对象
|
||||||
|
|
||||||
|
|
||||||
private User ChatNow;
|
|
||||||
internal User SetContact
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return ChatNow;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
ChatNow = value;
|
|
||||||
}
|
|
||||||
}//设置当前联系人对象
|
|
||||||
internal static void GetContactsList(ResultHead head, User[] users)
|
internal static void GetContactsList(ResultHead head, User[] users)
|
||||||
{
|
{
|
||||||
if (head.Error != "")
|
if (head.Error != "")
|
||||||
@@ -47,7 +35,10 @@ namespace StormChatWPF
|
|||||||
{
|
{
|
||||||
if (StormClient.Initialize())
|
if (StormClient.Initialize())
|
||||||
{
|
{
|
||||||
StormClient.QueueLogin(user,password);
|
if (!StormClient.QueueLogin(user, password))
|
||||||
|
{
|
||||||
|
MessageBox.Show("登录失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -68,7 +59,7 @@ namespace StormChatWPF
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("登录失败!");
|
MessageBox.Show("请核对账号密码!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}//登录完成
|
}//登录完成
|
||||||
|
|||||||
@@ -5,13 +5,25 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:StormChatWPF"
|
xmlns:local="clr-namespace:StormChatWPF"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="MainWindow" Height="450" Width="800">
|
Title="StormChat" Height="450" Width="800"
|
||||||
<Grid Margin="0,0,-0.4,-1">
|
Icon="UI/闪电.png">
|
||||||
<Image x:Name="LogImage" Margin="0,0,0,181" Source="/RESOURCES/logFormBackground.jpg" Stretch="None"/>
|
<Grid Height="418" VerticalAlignment="Stretch" Margin="2,1,1,1">
|
||||||
<Button x:Name="Login_button" Content="LogIn" Margin="361,370,361,32" RenderTransformOrigin="0.664,1.51" Click="Login_button_Click"/>
|
<Grid.ColumnDefinitions>
|
||||||
<TextBox x:Name="AccountBox" Margin="346,263,340,0" TextWrapping="Wrap" Text="201701110203" Height="15" VerticalAlignment="Top" />
|
<ColumnDefinition Width="200*"/>
|
||||||
<PasswordBox x:Name="passwordBox" Margin="346,311,0,0" Password="1233211234567" RenderTransformOrigin="0.503,0.59" Height="18" VerticalAlignment="Top" HorizontalAlignment="Left" Width="109"/>
|
<ColumnDefinition Width="200*"/>
|
||||||
|
<ColumnDefinition Width="200*"/>
|
||||||
|
<ColumnDefinition Width="200*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="150*"/>
|
||||||
|
<RowDefinition Height="150*"/>
|
||||||
|
<RowDefinition Height="150*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Image x:Name="LogBackground" Grid.ColumnSpan="4" Height="268" Margin="10,10,10,0" Grid.RowSpan="2" VerticalAlignment="Top" Source="UI/登录界面底.png"/>
|
||||||
|
<Button x:Name="Login_button" Content="LogIn" Click="Login_button_Click" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="2" Margin="160,70,160,45" Width="75"/>
|
||||||
|
<TextBox x:Name="AccountBox" TextWrapping="Wrap" Text="201701110203" Grid.Row="2" TextAlignment="Center" Margin="137.4,5,137.8,112.6" Grid.Column="1" Grid.ColumnSpan="2" Height="22" Width="120">
|
||||||
|
|
||||||
|
</TextBox>
|
||||||
|
<PasswordBox x:Name="passwordBox" Password="1233211234567" Margin="135,35,135,0" Grid.Column="1" Grid.Row="2" VerticalAlignment="Top" Grid.ColumnSpan="2" Height="22" Width="120"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace StormChatWPF
|
|||||||
}//将收到的消息展现于UI界面
|
}//将收到的消息展现于UI界面
|
||||||
internal void ShowUserMessage()
|
internal void ShowUserMessage()
|
||||||
{
|
{
|
||||||
}
|
}//展现自己发出的消息
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ namespace StormChatWPF
|
|||||||
}
|
}
|
||||||
private void AddUserList()
|
private void AddUserList()
|
||||||
{
|
{
|
||||||
if (Chat.userlist.Any())
|
if (Chat.ContactsList.Any())
|
||||||
{
|
{
|
||||||
foreach (var user in Chat.userlist)
|
foreach (var user in Chat.ContactsList)
|
||||||
{
|
{
|
||||||
UsersList.Items.Add(user);
|
UsersList.Items.Add(user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,5 +115,11 @@
|
|||||||
<Name>Interact</Name>
|
<Name>Interact</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="UI\登录界面底.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="UI\闪电.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Reference in New Issue
Block a user