完成使用者信息显示

This commit is contained in:
Kaniu Tayou
2018-12-29 17:32:32 +08:00
parent b42c7a132f
commit 6cea1b61c7
3 changed files with 4 additions and 14 deletions
@@ -29,7 +29,7 @@
</ScrollViewer.Content> </ScrollViewer.Content>
</ScrollViewer> </ScrollViewer>
<Image x:Name="User_HeadPicture" HorizontalAlignment="Left" Width="60" VerticalAlignment="Stretch"/> <Image x:Name="User_HeadPicture" HorizontalAlignment="Left" Width="60" VerticalAlignment="Stretch"/>
<Label x:Name="User_NickNmae" Content="Label" Margin="0,0,0.4,0" Height="40" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Right" Width="138"/> <Label x:Name="User_NickNmae" Content="Label" Margin="0,10,0.4,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Right" Width="140" FontSize="18" Height="30" VerticalAlignment="Top"/>
<Label x:Name="User_motto" Content="人生很长,慢慢走。" Margin="0,40,0.4,0" VerticalContentAlignment="Top" HorizontalAlignment="Right" Width="138" FontSize="6"/> <Label x:Name="User_motto" Content="人生很长,慢慢走。" Margin="0,40,0.4,0" VerticalContentAlignment="Top" HorizontalAlignment="Right" Width="138" FontSize="6"/>
</Grid> </Grid>
</Window> </Window>
@@ -31,10 +31,10 @@ namespace StormChatWPF
private void LoadUserMe() private void LoadUserMe()
{ {
BitmapImage image = new BitmapImage(); BitmapImage image = new BitmapImage();
User_HeadPicture.BeginInit(); image.BeginInit();
image.StreamSource = User.Me.Photo; image.StreamSource = User.Me.Photo;
User.Me.Photo.Seek(0, SeekOrigin.Begin); User.Me.Photo.Seek(0, SeekOrigin.Begin);
User_HeadPicture.EndInit(); image.EndInit();
User_HeadPicture.Source = image; User_HeadPicture.Source = image;
User_NickNmae.Content = User.Me.NickName; User_NickNmae.Content = User.Me.NickName;
User_motto.Content = User.Me.Motto; User_motto.Content = User.Me.Motto;
@@ -1,16 +1,6 @@
using System; using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace StormChatWPF.UI namespace StormChatWPF.UI
{ {