<?xml version="1.0" encoding="utf-8" ?>
<local:PlayerNotificationControlBase
    x:Class="BiliCopilot.UI.Controls.Core.PlayerNotificationControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:animations="using:CommunityToolkit.WinUI.Animations"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:BiliCopilot.UI.Extensions"
    xmlns:local="using:BiliCopilot.UI.Controls.Core"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Visibility="{x:Bind ViewModel.IsNotificationVisible, Mode=OneWay}"
    mc:Ignorable="d">

    <StackPanel MaxWidth="320" Margin="0,20">
        <InfoBar
            x:Name="Bar"
            Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}"
            CloseButtonCommand="{x:Bind ViewModel.CancelCommand, Mode=OneWay}"
            IsClosable="True"
            IsIconVisible="True"
            IsOpen="{x:Bind ViewModel.IsNotificationVisible, Mode=OneWay}"
            Message="{x:Bind ViewModel.Data.Message, Mode=OneWay}"
            Severity="Informational">
            <InfoBar.ActionButton>
                <HyperlinkButton Command="{x:Bind ViewModel.ActiveCommand, Mode=OneWay}" Content="{ext:Locale Name=Play}" />
            </InfoBar.ActionButton>
        </InfoBar>
        <ProgressBar
            Margin="0,4,0,0"
            HorizontalAlignment="Stretch"
            IsIndeterminate="False"
            Maximum="{x:Bind ViewModel.DurationInMilliseconds, Mode=OneWay}"
            Visibility="{x:Bind ViewModel.IsProgressVisible, Mode=OneWay}"
            Value="{x:Bind ViewModel.ProgressInMilliseconds, Mode=OneWay}" />

        <animations:Implicit.ShowAnimations>
            <animations:TranslationAnimation
                From="0,-20"
                To="0,0"
                Duration="0:0:0.24" />
            <animations:OpacityAnimation
                From="0.0"
                To="1.0"
                Duration="0:0:0.2" />
        </animations:Implicit.ShowAnimations>
    </StackPanel>
</local:PlayerNotificationControlBase>
