<Window xmlns:props="clr-namespace:Ink_Canvas.Properties" x:Class="Ink_Canvas.Windows.AnnouncementCenterWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="{x:Static props:AnnouncementStrings.CenterTitle}"
        Width="720"
        Height="560"
        WindowStartupLocation="CenterOwner"
        ui:ThemeManager.IsThemeAware="True"
        ui:WindowHelper.UseModernWindowStyle="True"
        ui:WindowHelper.CornerStyle="Round">
    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Text="{x:Static props:AnnouncementStrings.CenterTitle}"
                   FontSize="22"
                   FontWeight="SemiBold"
                   Margin="0,0,0,16" />

        <ui:ListView x:Name="AnnouncementListBox"
                     Grid.Row="1"
                     BorderThickness="0"
                     Background="Transparent"
                     HorizontalContentAlignment="Stretch"
                     SelectionChanged="AnnouncementListBox_SelectionChanged">
            <ui:ListView.Template>
                <ControlTemplate TargetType="ui:ListView">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                                      VerticalScrollBarVisibility="Auto">
                            <ItemsPresenter HorizontalAlignment="Stretch" />
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </ui:ListView.Template>
            <ui:ListView.ItemContainerStyle>
                <Style TargetType="ui:ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="Padding" Value="0" />
                    <Setter Property="MinHeight" Value="36" />
                </Style>
            </ui:ListView.ItemContainerStyle>
            <ui:ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel />
                </ItemsPanelTemplate>
            </ui:ListView.ItemsPanel>
            <ui:ListView.ItemTemplate>
                <DataTemplate>
                    <Border Padding="12"
                            Margin="0,0,0,8"
                            CornerRadius="8"
                            Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}">
                        <StackPanel>
                            <DockPanel LastChildFill="True">
                                <TextBlock Text="{Binding Type}"
                                           DockPanel.Dock="Right"
                                           Opacity="0.65"
                                           FontSize="12" />
                                <TextBlock Text="{Binding Title}"
                                           FontWeight="SemiBold"
                                           TextTrimming="CharacterEllipsis" />
                            </DockPanel>
                            <TextBlock Text="{Binding Summary}"
                                       Margin="0,6,0,0"
                                       TextWrapping="Wrap"
                                       Opacity="0.8" />
                            <TextBlock Text="{Binding CreatedAt, StringFormat={}{0:yyyy-MM-dd HH:mm}}"
                                       Margin="0,8,0,0"
                                       FontSize="12"
                                       Opacity="0.55" />
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </ui:ListView.ItemTemplate>
        </ui:ListView>

        <TextBlock x:Name="EmptyTextBlock"
                   Grid.Row="1"
                   Text="{x:Static props:AnnouncementStrings.NoItems}"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   Opacity="0.65"
                   Visibility="Collapsed" />

        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right"
                    Margin="0,16,0,0">
            <Button Content="{x:Static props:AnnouncementStrings.ClearHistory}"
                    Margin="0,0,8,0"
                    Click="ClearHistoryButton_Click" />
            <Button Content="{x:Static props:NotificationStrings.ViewDetails}"
                    Margin="0,0,8,0"
                    Click="ViewDetailsButton_Click" />
            <Button Content="{x:Static props:NotificationStrings.AnimationOff}"
                    Click="CloseButton_Click" />
        </StackPanel>
    </Grid>
</Window>
