<UserControl x:Class="NebulaAuth.HintBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:nebulaAuth="clr-namespace:NebulaAuth"
             mc:Ignorable="d"
             d:DataContext="{d:DesignInstance nebulaAuth:HintBox}"
             d:DesignHeight="100" d:DesignWidth="400">

    <Border Padding="5"
            BorderThickness="1"
            CornerRadius="12"
            Visibility="{Binding Text, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource NullableToVisibilityConverter}}">
        <Border.BorderBrush>
            <SolidColorBrush Color="{DynamicResource BaseShadowColor}" Opacity="0.5" />
        </Border.BorderBrush>
        <Border.Background>
            <SolidColorBrush Color="{DynamicResource Base300Color}" Opacity="0.2" />
        </Border.Background>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon Height="22" Width="22"
                                     VerticalAlignment="Center"
                                     Margin="5,0,0,0"
                                     Foreground="{Binding IconBrush, RelativeSource={RelativeSource AncestorType=UserControl}}"
                                     Kind="{Binding IconKind, RelativeSource={RelativeSource AncestorType=UserControl}}" />

            <TextBlock Grid.Column="1"
                       FontSize="{Binding FontSize, RelativeSource={RelativeSource AncestorType=UserControl}}"
                       TextWrapping="WrapWithOverflow"
                       VerticalAlignment="Center"
                       Margin="10,10,10,10"
                       Text="{Binding Text, RelativeSource={RelativeSource AncestorType=UserControl}}" />

            <Button Grid.Column="2"
                    Visibility="{Binding ShowCloseButton, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource BooleanToVisibilityConverter}}"
                    Command="{Binding CloseCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
                    Style="{StaticResource MaterialDesignToolButton}"
                    Margin="0,0,5,0"
                    Padding="2">
                <materialDesign:PackIcon Kind="Close" Width="18" Height="18" />
            </Button>
        </Grid>
    </Border>
</UserControl>