<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:CommunityToolkit.WinUI.Controls"
    xmlns:fluent="using:FluentIcons.WinUI"
    xmlns:local="using:Pixeval.Controls">
    <Style TargetType="local:TokenInputTextBox">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TokenInputTextBox">
                    <!--  ReSharper disable Xaml.ConstructorWarning  -->
                    <controls:DockPanel
                        Height="{TemplateBinding Height}"
                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                        HorizontalSpacing="5">
                        <!--  ReSharper disable once UnusedMember.Local  -->
                        <Button
                            x:Name="SubmitButton"
                            x:Uid="/TokenInputTextBox/SubmitButton"
                            Width="32"
                            Height="32"
                            Padding="0"
                            controls:DockPanel.Dock="Right"
                            Content="{fluent:SymbolIcon Symbol=ArrowTurnDownLeft,
                                                        FontSize={StaticResource SmallIconFontSize}}"
                            Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SubmitEnable, Mode=OneWay}" />
                        <ToggleButton
                            x:Uid="/TokenInputTextBox/IsRegularExpressionCheckBox"
                            Width="32"
                            Height="32"
                            Padding="0"
                            controls:DockPanel.Dock="Right"
                            Content="{fluent:SymbolIcon Symbol=Code,
                                                        FontSize={StaticResource SmallIconFontSize}}"
                            IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Token.IsRegularExpression, Mode=TwoWay}" />
                        <ToggleButton
                            x:Uid="/TokenInputTextBox/CaseSensitiveCheckBox"
                            Width="32"
                            Height="32"
                            Padding="0"
                            controls:DockPanel.Dock="Right"
                            Content="{fluent:SymbolIcon Symbol=TextChangeCase,
                                                        FontSize={StaticResource SmallIconFontSize}}"
                            IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Token.CaseSensitive, Mode=TwoWay}" />
                        <!--  ReSharper disable once UnusedMember.Local  -->
                        <TextBox
                            x:Name="TokenTextBox"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Center"
                            PlaceholderText="{TemplateBinding PlaceholderText}"
                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Token.TokenContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    </controls:DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
