<UserControl x:Class="SWRIS.Controls.NotificationBar"
             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:SWRIS.Controls" 
             xmlns:cvt="clr-namespace:SWRIS.Converters"
             mc:Ignorable="d" x:Name="Root"
             d:DesignHeight="50" d:DesignWidth="800">
    <UserControl.Resources>
        <cvt:CollectionCountToVisibilityConverter x:Key="CollectionCountToVisibilityConverter"/>
    </UserControl.Resources>
    <Grid>
        <Border Background="#1AFF0000"
            CornerRadius="{Binding ElementName=Root,Path=CornerRadius}" 
            Padding="{Binding ElementName=Root,Path=TextPadding}"
            Visibility="{Binding Messages.Count, Converter={StaticResource CollectionCountToVisibilityConverter}}">
            <ItemsControl ItemsSource="{Binding Messages}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="5 0">
                            <Grid Width="22" Height="22" Margin="0 0 8 0">
                                <Ellipse Fill="#4DFF2626" Width="22" Height="22"/>
                                <Ellipse Fill="#FF2626" Width="10" Height="10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>
                            <TextBlock Text="{Binding}" Foreground="#FF0000" VerticalAlignment="Center"/>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </Border>
    </Grid>
</UserControl>