<?xml version="1.0" encoding="utf-8" ?>
<base:LayoutUserControlBase
    x:Class="BiliCopilot.UI.Controls.Player.CoinButton"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:base="using:Richasy.WinUIKernel.Share.Base"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ext="using:BiliCopilot.UI.Extensions"
    xmlns:ic="using:FluentIcons.WinUI"
    xmlns:local="using:BiliCopilot.UI.Controls.Player"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <StackPanel Spacing="8">
            <ToggleButton
                x:Name="Btn"
                Width="48"
                Height="48"
                Padding="0"
                HorizontalAlignment="Center"
                HorizontalContentAlignment="Center"
                VerticalContentAlignment="Center"
                Checked="OnChecked"
                Click="OnCoinButtonClick"
                CornerRadius="24"
                IsChecked="{x:Bind IsCoined, Mode=OneWay}"
                IsEnabled="True"
                ToolTipService.ToolTip="{ext:Locale Name=Coin}"
                Unchecked="OnUnchecked">
                <ic:SymbolIcon
                    FontSize="16"
                    IconVariant="{x:Bind IsCoined, Mode=OneWay, Converter={StaticResource BoolToIconVariantConverter}}"
                    Symbol="Blur" />
            </ToggleButton>
            <TextBlock
                HorizontalAlignment="Center"
                Style="{StaticResource CaptionTextBlockStyle}"
                Text="{x:Bind Tip, Mode=OneWay}" />
        </StackPanel>
        <TeachingTip
            x:Name="CoinTip"
            ActionButtonClick="OnOneCoinButtonClick"
            ActionButtonContent="{ext:Locale Name=OneCoin}"
            CloseButtonClick="OnTwoCoinButtonClick"
            CloseButtonContent="{ext:Locale Name=TwoCoin}"
            IsLightDismissEnabled="True"
            PreferredPlacement="Top"
            ShouldConstrainToRootBounds="False"
            Subtitle="{ext:Locale Name=CoinTip}"
            Target="{x:Bind Btn}">
            <TeachingTip.Content>
                <CheckBox Content="{ext:Locale Name=AlsoLike}" IsChecked="{x:Bind AlsoLike, Mode=TwoWay}" />
            </TeachingTip.Content>
        </TeachingTip>
    </Grid>
</base:LayoutUserControlBase>
