void addView(string displayName)
{
Border b = new Border();
b.CornerRadius = new CornerRadius(10);
b.Margin = new Thickness(0, 4, 0, 0);
//设置渐变背景色
LinearGradientBrush myLinearGradientBrush = new LinearGradientBrush();
myLinearGradientBrush.StartPoint = new Point(0.5, 0.16);
myLinearGradientBrush.EndPoint = new Point(0.5, 1.0);
myLinearGradientBrush.GradientStops.Add(new GradientStop(Color.FromRgb(0, 122, 255), 0.0));
myLinearGradientBrush.GradientStops.Add(new GradientStop(Color.FromRgb(14, 63, 242), 1.0));
b.Background = myLinearGradientBrush;
//使用stackpanel添加图片文字等控件
StackPanel sp = new StackPanel();
b.Child = sp;
sp.Height = 135;
//图片
Image myimage = new Image();
myimage.Source = new BitmapImage(new Uri("pack://application:,,,/Res/MeetingIcon/avatar_40.png"));
myimage.Width = 40;
myimage.Height = 40;
myimage.Margin = new Thickness(0, 47.5, 0, 0);
myimage.HorizontalAlignment = HorizontalAlignment.Center;
//用户名
TextBlock mytext = new TextBlock();
mytext.Text = displayName;
mytext.FontSize = 14;
mytext.Foreground = new SolidColorBrush(Colors.White);
mytext.Margin = new Thickness(8, 24.5, 0, 0);
sp.Children.Add(myimage);
sp.Children.Add(mytext);
memberViewContainer.Children.Add(b);
}