Answers for "button background when get foucus"

0

button background when get foucus

<Button Content="Click Me" Background="Blue">
    <Button.Template>
        <ControlTemplate TargetType="{x:Type Button}">
            <Border Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Button.IsFocused" Value="True">
                    <Setter TargetName="Border" Property="Background" Value="White" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Button.Template>
</Button>
Posted by: Guest on May-25-2020

Code answers related to "button background when get foucus"

Browse Popular Code Answers by Language