FloydReme
4/12/2018 - 6:19 PM

Round Button with color-change

  <Style x:Key="BackColor"  TargetType="{x:Type Button}">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="50"/>
            <Setter Property="Content" Value="SEND"/> 
            <Setter Property="Background" Value="#FF06C548"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="FontFamily" Value="Global User Interface"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Border CornerRadius="17" Background="{TemplateBinding Background}">
                                <ContentPresenter
                                HorizontalAlignment="Center" 
                                VerticalAlignment="Center"  
                                Height="63"
                                Margin="192,17,177,10"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            <Style.Triggers>
                <EventTrigger RoutedEvent="MouseEnter">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
                                            To="#FF0EAC44"
                                            Duration="0:0:0.4"
                                            FillBehavior="HoldEnd"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseLeave">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
                                            To="#FF06C548"
                                            Duration="0:0:0.4"
                                            FillBehavior="HoldEnd"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="Click">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
                                            To="#FF1B74CB"
                                            Duration="0:0:0.4"
                                            FillBehavior="HoldEnd"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>