<Window x:Class="TemplatesPropertiesBinding.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.Resources>
            <ControlTemplate x:Key="ButtonTemplate" TargetType="{x:Type Button}">
                <Viewbox Stretch="Fill">
                    <Grid Height="100" Width="100">
                        <Ellipse x:Name="Background" Fill="{TemplateBinding Background}">
                            <Ellipse.Effect>
                                <DropShadowEffect x:Name="SHEffect" Opacity="0" BlurRadius="20" Color="{Binding BorderBrush.Color, RelativeSource={RelativeSource Mode=TemplatedParent}}" ShadowDepth="0"/>
                            </Ellipse.Effect>
                        </Ellipse>
                        <Ellipse x:Name="CentralBrightening" Opacity="0.2">
                            <Ellipse.Fill>
                                <RadialGradientBrush>
                                    <GradientStop Color="Black" Offset="1"/>
                                    <GradientStop Color="White"/>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Path x:Name="GlassLayer" Data="M90,45 C90,69.852814 69.852814,40 45,40 20.147186,40 0,69.852814 0,45 0,20.147186 20.147186,0 45,0 69.852814,0 90,20.147186 90,45 z" Margin="5,5,5,40.117" Stretch="Fill">
                            <Path.Fill>
                                <RadialGradientBrush Center="0.5,0.842" GradientOrigin="0.5,0.842" RadiusY="0.828">
                                    <GradientStop Offset="0" Color="#00FFFFFF" />
                                    <GradientStop Offset="1" Color="#F2FFFFFF"/>
                                </RadialGradientBrush>
                            </Path.Fill>
                        </Path>
                        <Ellipse x:Name="FlashLayer" Fill="{TemplateBinding BorderBrush}" Margin="3">
                            <Ellipse.OpacityMask>
                                <RadialGradientBrush Center="0.511,0.97" GradientOrigin="0.511,0.97" RadiusY="0.362">
                                    <GradientStop Color="Black" Offset="0"/>
                                    <GradientStop Offset="1"/>
                                </RadialGradientBrush>
                            </Ellipse.OpacityMask>
                        </Ellipse>
                        <Ellipse x:Name="FlashWhite" Margin="3">
                            <Ellipse.Fill>
                                <RadialGradientBrush Center="0.533,0.949" GradientOrigin="0.533,0.949" RadiusY="0.287" RadiusX="0.415">
                                    <GradientStop Offset="1"/>
                                    <GradientStop Color="White"/>
                                </RadialGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Padding}" />
                    </Grid>
                </Viewbox>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Trigger.EnterActions>
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.25" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SHEffect"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </Trigger.EnterActions>
                        <Trigger.ExitActions>
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation Duration="0:0:0.25" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SHEffect"/>
                                </Storyboard>
                            </BeginStoryboard>
                        </Trigger.ExitActions>
                    </Trigger>
                    <Trigger Property="ButtonBase.IsPressed" Value="True">
                        <Setter Property="RenderTransform">
                            <Setter.Value>
                                <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Grid.Resources>
        <Button Foreground="Black" Template="{StaticResource ButtonTemplate}"  BorderBrush="#FF36EDE9" Background="#FF195083" Width="100" Height="100" >
            <Rectangle Fill="White" Height="25" Width="25"/>
        </Button>
    </Grid>
</Window>
