<UserControl x:Class="HistoryView.Controls.UserInfo"
             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:HistoryView.Controls"
             mc:Ignorable="d" 
             x:Name="This"
             d:DesignHeight="450" d:DesignWidth="800">
    <Border CornerRadius="4" BorderThickness="1" MinWidth="180" BorderBrush="Black" Background="{StaticResource BackgroundDarkColor}">
        <Grid Margin="16">

            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="16"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>

            <Grid Grid.Column="2" HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="16"/>
                    <ColumnDefinition/>
          
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{StaticResource Icon_User}" VerticalAlignment="Center" Height="36"/>
                
                <Grid Grid.Column="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="2"/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Row="0" FontSize="14" VerticalAlignment="Center" Foreground="{StaticResource TextColor}" Text="{Binding ElementName=This, Path=User.UserName}"/>
                    <TextBlock Grid.Row="2" VerticalAlignment="Center" Foreground="{StaticResource TextColor}" Text="{Binding ElementName=This, Path=User.Authority}"/>
                </Grid>
            </Grid>

            <Button Grid.Row="2" Style="{StaticResource FunctionButton}" Background="{StaticResource WarningColor}" Command="{Binding ElementName=This, Path=SwitchUserCommand}" Height="32">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="8"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Image Grid.Column="0" Source="{StaticResource Icon_Switch}" Height="16"/>
                    <TextBlock Grid.Column="2" Text="{DynamicResource SwitchUser}"/>
                </Grid>
            </Button>
        </Grid>
    </Border>
</UserControl>
