<UserControl x:Class="GitHub.VisualStudio.Views.InlineAnnotationView"
             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:ghfvs="https://github.com/github/VisualStudio"
             xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging"
             xmlns:catalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog"  
             mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">

    <d:DesignProperties.DataContext>
        <ghfvs:InlineAnnotationViewModelDesigner />
    </d:DesignProperties.DataContext>

    <Border BorderBrush="{DynamicResource VsBrush.ScrollBarThumbBackground}" BorderThickness="0 0 0 1" HorizontalAlignment="Stretch" Margin="0">
        <Grid Background="{DynamicResource VsBrush.ToolWindowBackground}" HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="4" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <StackPanel Background="#23a1d0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="5" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Notice}}" />
            <StackPanel Background="#f8d45c" Grid.Row="0" Grid.Column="0" Grid.RowSpan="5" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Warning}}"/>
            <StackPanel Background="#cc180e" Grid.Row="0" Grid.Column="0" Grid.RowSpan="5" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Failure}}"/>

            <Border Grid.Column="1" Padding="8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions> 

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions> 

                    <StackPanel Grid.Column="0" Grid.Row="0" Background="Transparent" VerticalAlignment="Center">
                        <imaging:CrispImage  Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusInformation}" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Notice}}"/>
                        <imaging:CrispImage  Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusWarning}" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Warning}}"/>
                        <imaging:CrispImage  Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusError}" Visibility="{Binding Model.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Failure}}"/>
                    </StackPanel>

                    <TextBlock Grid.Column="1" Grid.Row="0" Margin="4 0 0 0" Foreground="{DynamicResource VsBrush.ToolWindowText}">
                        <Run FontWeight="SemiBold" Text="{Binding Model.Path, Mode=OneWay}"/>
                    </TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="1" FontSize="14" Margin="4 8 0 8" Foreground="{DynamicResource VsBrush.ToolWindowText}">
                        <Run FontWeight="SemiBold" Text="{Binding Model.CheckSuiteName, Mode=OneWay}"/>
                        <Run Text="/"/>
                        <Run Text="{Binding Model.CheckRunName, Mode=OneWay}"/>
                    </TextBlock>

                    <TextBlock Grid.Column="1" Grid.Row="2" FontWeight="SemiBold" Margin="4 0 0 8" Foreground="{DynamicResource VsBrush.ToolWindowText}">
                        <Run Text="{Binding Model.Title, Mode=OneWay}"/>
                    </TextBlock>

                    <TextBlock HorizontalAlignment="Stretch" TextWrapping="Wrap" Grid.Column="1" Grid.Row="3" Margin="4 0 0 0" FontFamily="Consolas" FontSize="12" Text="{Binding Model.Message}" Foreground="{DynamicResource VsBrush.ToolWindowText}" />
                </Grid>
            </Border>
        </Grid>
    </Border>
</UserControl>

