优化布局

This commit is contained in:
Kaniu Tayou
2018-12-29 08:28:31 +08:00
parent 688a53a9dd
commit b95581b63c
8 changed files with 63 additions and 11 deletions
@@ -5,13 +5,13 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StormChatWPF.UI"
mc:Ignorable="d"
d:DesignHeight="40" d:DesignWidth="120" HorizontalAlignment="Stretch">
d:DesignHeight="40" d:DesignWidth="120">
<Grid>
<WrapPanel Height="40" VerticalAlignment="Stretch">
<Image x:Name="HeadPicture" HorizontalAlignment="Left" Height="40" Width="40"/>
<Label x:Name="text" Content="Label" Height="40" FontSize="14" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Center"/>
</WrapPanel>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="80*"/>
</Grid.ColumnDefinitions>
<Image x:Name="HeadPicture" HorizontalAlignment="Left" Height="40" Width="40"/>
<Label x:Name="text" Content="Label" Height="40" FontSize="14" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Right" Grid.Column="1" Width="80"/>
</Grid>
</UserControl>
@@ -14,6 +14,7 @@ namespace StormChatWPF.UI
image.EndInit();
HeadPicture.Source = image;
text.Content = user.NickName;
Width = 120;
}
BitmapImage image = new BitmapImage();
}
@@ -0,0 +1,17 @@
<UserControl x:Class="StormChatWPF.UI.UserMeHeadInfo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StormChatWPF.UI"
mc:Ignorable="d"
d:DesignHeight="60" d:DesignWidth="200">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60*"/>
<ColumnDefinition Width="120*"/>
</Grid.ColumnDefinitions>
<Image x:Name="image" Height="60" Margin="0,0,0,0" VerticalAlignment="Top"/>
</Grid>
</UserControl>
@@ -0,0 +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
{
/// <summary>
/// UserMeHeadInfo.xaml 的交互逻辑
/// </summary>
public partial class UserMeHeadInfo : UserControl
{
public UserMeHeadInfo()
{
InitializeComponent();
}
}
}