﻿<Styles xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:customControls="using:Lumafly.Views.Controls">
    <Design.PreviewWith>
        <customControls:TextButtonFlyout />
    </Design.PreviewWith>

    <Style Selector="customControls|TextButtonFlyout">
        <!-- Set Defaults -->
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Background" Value="{DynamicResource DefaultButtonColor}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <ControlTemplate>
                <Button
                    HorizontalContentAlignment="Stretch"
                    Padding="{TemplateBinding Padding}"
                    Margin="{TemplateBinding Margin}"
                    Background="{TemplateBinding Background}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Name="Button">
                    <Button.Styles>
                        <Style Selector="Button:pointerover">
                            <Setter Property="Background" Value="{DynamicResource DefaultButtonColor}"></Setter>
                        </Style>
                    </Button.Styles>
                    <Grid 
                        ColumnDefinitions="*, Auto"
                        HorizontalAlignment="Stretch">
                        <TextBlock
                            Grid.Column="0"
                            Text="{TemplateBinding Header}"
                            Padding="3 0"/>
                        
                        <PathIcon
                            Grid.Column="1"
                            Name="Icon" 
                            Data="{StaticResource chevron_down_regular}"
                            Width="15" Height="15"
                            Margin="5 0 2 0"/>
                    </Grid>
                </Button>
            </ControlTemplate>
        </Setter>
    </Style>
</Styles>
