<UserControl x:Class="Ink_Canvas.Controls.DynamicNotificationControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
             mc:Ignorable="d"
             Width="460"
             HorizontalAlignment="Center"
             VerticalAlignment="Top"
             Visibility="Collapsed"
             Opacity="0"
             IsHitTestVisible="True"
             MouseEnter="UserControl_MouseEnter"
             MouseLeave="UserControl_MouseLeave">
    <UserControl.RenderTransform>
        <TranslateTransform x:Name="RootTransform" Y="-24" />
    </UserControl.RenderTransform>

    <Grid x:Name="RootContainer"
          Margin="0,24,0,0"
          MouseLeftButtonUp="RootBorder_MouseLeftButtonUp">
        <Border x:Name="RootBorder"
                Padding="14,10"
                CornerRadius="24"
                BorderThickness="1">
        <Border.Effect>
            <DropShadowEffect BlurRadius="24" ShadowDepth="4" Opacity="0.28" Color="#000000" />
        </Border.Effect>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="32" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Border x:Name="IconBackgroundBorder"
                    Grid.Row="0"
                    Grid.Column="0"
                    Width="28"
                    Height="28"
                    CornerRadius="14"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center">
                <Grid Width="28" Height="28">
                    <Ellipse Stroke="{Binding Foreground, ElementName=IconGlyph}"
                             StrokeThickness="1.8"
                             Width="16"
                             Height="16"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center" />
                    <Rectangle Fill="{Binding Foreground, ElementName=IconGlyph}"
                               Width="1.8"
                               Height="6.5"
                               RadiusX="0.9"
                               RadiusY="0.9"
                               Margin="0,4.5,0,0"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center" />
                    <Ellipse Fill="{Binding Foreground, ElementName=IconGlyph}"
                             Width="2"
                             Height="2"
                             Margin="0,-7.5,0,0"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center" />
                    <ui:FontIcon x:Name="IconGlyph"
                                 FontSize="1"
                                 Visibility="Hidden" />
                </Grid>
            </Border>

            <StackPanel Grid.Row="0" Grid.Column="1" Margin="10,0,8,0" VerticalAlignment="Center">
                <TextBlock x:Name="TitleTextBlock"
                           FontSize="14"
                           FontWeight="SemiBold"
                           TextTrimming="CharacterEllipsis" />
                <TextBlock x:Name="SummaryTextBlock"
                           Margin="0,2,0,0"
                           FontSize="12"
                           TextTrimming="CharacterEllipsis" />
            </StackPanel>

            <Button Grid.Row="0"
                    Grid.Column="2"
                    Width="28"
                    Height="28"
                    Padding="0"
                    Background="Transparent"
                    BorderThickness="0"
                    Click="CloseButton_Click">
                <TextBlock x:Name="CloseButtonText" Text="×" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Button>

            <StackPanel x:Name="ExpandedPanel"
                        Grid.Row="1"
                        Grid.Column="0"
                        Grid.ColumnSpan="3"
                        Margin="0,12,0,0"
                        Visibility="Collapsed">
                <TextBlock x:Name="ContentTextBlock"
                           FontSize="13"
                           TextWrapping="Wrap"
                           TextTrimming="CharacterEllipsis"
                           MaxHeight="96" />
                <StackPanel Margin="0,12,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button x:Name="ActionButton"
                            MinWidth="92"
                            Padding="14,6"
                            BorderThickness="1"
                            Click="ActionButton_Click" />
                </StackPanel>
            </StackPanel>
            </Grid>
        </Border>

        <Canvas Panel.ZIndex="1"
                IsHitTestVisible="False">
            <Path x:Name="CountdownProgressPath"
                  StrokeThickness="2.5"
                  StrokeStartLineCap="Round"
                  StrokeEndLineCap="Round"
                  StrokeLineJoin="Round"
                  Visibility="Collapsed" />
        </Canvas>
    </Grid>
</UserControl>
