<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:xoc="clr-namespace:Xomega.Framework.Converters;assembly=Xomega.Framework.Wpf"
             x:Class="AdventureWorks.Client.Wpf.Errors"
             BorderThickness="1" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
  <UserControl.Resources>
    <xoc:SeverityToBrushConverter x:Key="SevBrushConverter"/>
    <xoc:SeverityToIconConverter x:Key="SevIconConverter"/>
  </UserControl.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <DockPanel Grid.Row="0" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
      <Button x:Name="btnClose" Content="X" DockPanel.Dock="Right" Width="20" Margin="10,0,0,0" Click="btnClose_Click"
                Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                BorderBrush="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" FontFamily="Arial"/>
      <TextBlock Text="Please review the following messages" x:Name="title" Margin="5,0" FontWeight="Medium"/>
    </DockPanel>
    <ItemsControl Grid.Row="1" x:Name="lstErrors" Margin="5">
      <ItemsControl.ItemTemplate>
        <DataTemplate>
          <StackPanel Orientation="Horizontal">
            <Rectangle Fill="{Binding Severity, Converter={StaticResource SevIconConverter}}" Width="16" Height="16" Margin="5,1,5,1"/>
            <TextBlock Text="{Binding Message}" Foreground="{Binding Severity, Converter={StaticResource SevBrushConverter}}" TextWrapping="Wrap"/>
          </StackPanel>
        </DataTemplate>
      </ItemsControl.ItemTemplate>
    </ItemsControl>
  </Grid>
</UserControl>
