<UserControl
    x:Class="Bili.App.Controls.Community.CommentBox"
    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:icons="using:Richasy.FluentIcon.Uwp"
    xmlns:loc="using:Bili.App.Resources.Extension"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <Grid
        Grid.Row="2"
        Padding="12,8"
        Background="{ThemeResource CardBackgroundFillColorDefault}"
        ColumnSpacing="12"
        CornerRadius="{StaticResource ControlCornerRadius}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid
            Margin="0,0,0,4"
            ColumnSpacing="8"
            Visibility="{x:Bind ReplyTip, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock
                Style="{StaticResource CaptionTextBlockStyle}"
                HorizontalAlignment="Left"
                Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                Text="{x:Bind ReplyTip, Mode=OneWay}" />
            <Button
                Grid.Column="1"
                Width="20"
                Height="20"
                Padding="0"
                VerticalAlignment="Top"
                Background="Transparent"
                BorderBrush="Transparent"
                BorderThickness="0"
                Command="{x:Bind ResetSelectedCommand, Mode=OneWay}"
                CornerRadius="10">
                <icons:RegularFluentIcon FontSize="10" Symbol="Dismiss12" />
            </Button>
        </Grid>
        <TextBox
            x:Name="ReplyBox"
            Grid.Row="1"
            MaxHeight="80"
            Padding="12,10,8,8"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            AcceptsReturn="True"
            Background="Transparent"
            AllowFocusOnInteraction="True"
            BorderThickness="0"
            PlaceholderText="{loc:Locale Name=ReplyPlaceholderText}"
            Text="{x:Bind Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
            TextWrapping="Wrap" />

        <Button
            x:Name="SendReplyButton"
            Grid.Row="1"
            Grid.Column="1"
            Width="40"
            Height="40"
            VerticalAlignment="Top"
            Command="{x:Bind SendCommand, Mode=OneWay}">
            <icons:RegularFluentIcon
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                FontSize="16"
                Symbol="Send20" />
        </Button>
    </Grid>
</UserControl>
