<UserControl x:Class="HandyControlDemo.UserControl.Avatar"
             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" 
             Margin="16"
             Effect="{StaticResource EffectShadow5}" 
             Cursor="Hand"
             mc:Ignorable="d">
    <Button Style="{StaticResource ButtonCustom}" Click="ButtonAvatar_OnClick">
        <Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="10">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Image Source="{Binding Source,RelativeSource={RelativeSource AncestorType=UserControl}}" Height="120" Width="120" Stretch="Uniform" Margin="10"/>
                <TextBlock TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="0,0,0,10" Grid.Row="1" Style="{StaticResource TextBlockDefault}" Text="{Binding UserName,RelativeSource={RelativeSource AncestorType=UserControl}}"></TextBlock>
            </Grid>
        </Border>
    </Button>
</UserControl>
