OverviewFilesCommitsIssuesDocsReleasesPeers

ifsrenderer-linux / WpfDisplay / Views / PaletteButton.xaml

35 lines · xaml ref:
<Button x:Class="WpfDisplay.Views.PaletteButton"
             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:local="clr-namespace:WpfDisplay.Views"
             mc:Ignorable="d" 
             x:Name="paletteButton"
             Style="{StaticResource MaterialDesignRaisedButton}"
             d:DesignHeight="450" d:DesignWidth="800">
    <Button.Background>
        <LinearGradientBrush x:Name="gradientBrush" StartPoint="0,0" EndPoint="1,1"/>
    </Button.Background>
    <!--HACK: text shadow above colored background-->
    <Button.Template>
        <ControlTemplate TargetType="Button">
            <Grid>
                <Label
                    Background="{Binding Background, ElementName=paletteButton}"></Label>
                <TextBlock Text="{TemplateBinding Content}"
                            Style="{StaticResource MaterialDesignButtonTextBlock}"
                            Padding="{Binding Padding, ElementName=paletteButton}"
                            Foreground="White"
                            TextAlignment="Center"
                           Background="Transparent"
                            >
                    <TextBlock.Effect>
                        <DropShadowEffect Color="Black" BlurRadius="5" ShadowDepth="1" />
                    </TextBlock.Effect>
                </TextBlock>
            </Grid>
        </ControlTemplate>
    </Button.Template>
</Button>