<UserControl
    x:Class="Microsoft.PowerToys.Settings.UI.Controls.ColorPickerButton"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">

    <Grid>
        <!--TODO(stefan): ToDisplayName is no longer available in ColorHelper
        <DropDownButton Padding="4,4,8,4" AutomationProperties.FullDescription="{x:Bind clr:ColorHelper.ToDisplayName(SelectedColor), Mode=OneWay }">
        -->
        <DropDownButton Padding="4,4,8,4">
            <Border
                x:Name="ColorPreviewBorder"
                Width="48"
                Height="24"
                BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
                BorderThickness="1"
                CornerRadius="{ThemeResource ControlCornerRadius}">
                <Border.Background>
                    <SolidColorBrush Color="{x:Bind SelectedColor, Mode=OneWay}" />
                </Border.Background>
            </Border>
            <DropDownButton.Flyout>
                <Flyout ShouldConstrainToRootBounds="False">
                    <ColorPicker
                        IsAlphaEnabled="False"
                        IsAlphaSliderVisible="False"
                        IsAlphaTextInputVisible="False"
                        IsColorChannelTextInputVisible="True"
                        IsColorSliderVisible="True"
                        IsHexInputVisible="True"
                        Color="{x:Bind SelectedColor, Mode=TwoWay}" />
                </Flyout>
            </DropDownButton.Flyout>
        </DropDownButton>
    </Grid>
</UserControl>
