<local:CenterPopup
    x:Class="Bili.App.Controls.AvBvConverterView"
    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:loc="using:Bili.App.Resources.Extension"
    xmlns:local="using:Bili.App.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    Title="{loc:Locale Name=AvBvConverter}"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <Grid RowSpacing="8">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock
            Style="{StaticResource CaptionTextBlockStyle}"
            Foreground="{ThemeResource TextFillColorSecondaryBrush}"
            Text="{loc:Locale Name=AvBvConverterIntroduce}"
            TextWrapping="Wrap" />

        <muxc:InfoBar
            Grid.Row="1"
            HorizontalAlignment="Stretch"
            IsClosable="True"
            IsOpen="{x:Bind _viewModel.IsError, Mode=OneWay}"
            Message="{x:Bind _viewModel.ErrorMessage, Mode=OneWay}"
            Severity="Error" />

        <TextBox
            Grid.Row="2"
            Height="100"
            HorizontalAlignment="Stretch"
            Header="{loc:Locale Name=Input}"
            PlaceholderText="{loc:Locale Name=AvBvId}"
            Text="{x:Bind _viewModel.InputId, Mode=TwoWay}" />

        <Button
            Style="{StaticResource AccentButtonStyle}"
            Grid.Row="3"
            Margin="0,4,0,12"
            HorizontalAlignment="Stretch"
            Command="{x:Bind _viewModel.ConvertCommand}"
            Content="{loc:Locale Name=Convert}" />

        <TextBox
            Grid.Row="4"
            Height="100"
            Margin="0,0,0,12"
            HorizontalAlignment="Stretch"
            GotFocus="OnOutputBoxGotFocus"
            Header="{loc:Locale Name=Output}"
            IsReadOnly="True"
            Text="{x:Bind _viewModel.OutputId, Mode=OneWay}" />
    </Grid>
</local:CenterPopup>
