WPF写圆形头像,带消息提醒图标

<DockPanel VerticalAlignment="Top" HorizontalAlignment="Stretch" Margin="0" Height="100" >
<DockPanel.Background>
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,1" Opacity="0.5">
<GradientStop Offset="0.097" Color="#E6E6E6"></GradientStop>
<GradientStop Offset="0.227" Color="#E6E6E6"></GradientStop>
<GradientStop Offset="0.428" Color="#E6E6E6"></GradientStop>
<GradientStop Offset="0.779" Color="#E6E6E6"></GradientStop>
<GradientStop Offset="0.946" Color="#FFE7E7E7"></GradientStop>
</LinearGradientBrush>
</DockPanel.Background>

//开始头像
<Ellipse Cursor="Hand" Height="80" Width="80" Margin="25,10,0,10">
<Ellipse.Fill>
<VisualBrush>
<VisualBrush.Visual>
<Image x:Name="image" Source="/ppm.ec.erp.fore.Main;component/Resources/Imgs/testuser2.png"/>
</VisualBrush.Visual>
</VisualBrush>
</Ellipse.Fill>
</Ellipse>

//头像结束

//定位 消息提醒图标开始

<Canvas>
<Label x:Name="PushMsg" Width="25" Height="25" Foreground="#fff" Canvas.Left="-15" Canvas.Top="10" Content="99+" HorizontalAlignment="Center" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" FontSize="11">
<Label.Background>
<ImageBrush ImageSource="/ppm.ec.erp.fore.Main;component/Resources/Imgs/pushmsg.png"></ImageBrush>
</Label.Background>
</Label>
</Canvas>
 //定位消息提箱图标结束
</DockPanel>

posted @ 2018-01-23 11:08  xiao小智  阅读(434)  评论(0编辑  收藏  举报