math-suite/Source/Calculator/Styles/Buttons.xaml

102 lines
4.5 KiB
Plaintext
Raw Permalink Normal View History

2018-02-05 23:24:46 +00:00
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTemplate x:Key="CalcButton" TargetType="{x:Type Button}">
<Grid>
<Border Background="{TemplateBinding Background}" CornerRadius="5" BorderThickness="1"/>
<Border Name="BorderHover" CornerRadius="5" Opacity="0">
<Border.Background>
<RadialGradientBrush GradientOrigin=".5,1" Center=".5, .8">
<GradientStop Color="Orange" Offset="0" />
<GradientStop Color="OrangeRed" Offset="1" />
</RadialGradientBrush>
</Border.Background>
<Border.BitmapEffect>
<DropShadowBitmapEffect Color="Orange" ShadowDepth="1" Softness=".3"/>
</Border.BitmapEffect>
</Border>
<Border Name="BorderDown" CornerRadius="5" Opacity="0"
Background="DarkRed" />
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
<Border CornerRadius="5" >
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#40FFFFFF" Offset="0" />
<GradientStop Color="#70FFFFFF" Offset=".5" />
<GradientStop Color="#40FFFFFF" Offset=".5" />
<GradientStop Color="Transparent" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="BorderHover"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.5"
AccelerationRatio=".02" DecelerationRatio=".2"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Button.MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="BorderHover"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.7"
AccelerationRatio=".1" DecelerationRatio=".03"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="BorderDown" Property="Opacity" Value=".3" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style TargetType="{x:Type Button}">
<Setter Property="Margin" Value="2,0,2,2" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Background" >
<Setter.Value>
<RadialGradientBrush GradientOrigin=".5,1" Center=".5, .8">
<GradientStop Color="LightBlue" Offset="0" />
<GradientStop Color="#62B1D0" Offset="1" />
</RadialGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Focusable" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template" Value="{StaticResource CalcButton}" />
</Style>
<Style x:Key="BigButton" TargetType="{x:Type Button}">
<Setter Property="Margin" Value="2,4,2,2" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Background" >
<Setter.Value>
<RadialGradientBrush GradientOrigin=".5,1" Center=".5, .8" RadiusX=".5">
<GradientStop Color="#C0F0D0" Offset="0" />
<GradientStop Color="#60d6A7" Offset="1" />
</RadialGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Focusable" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template" Value="{StaticResource CalcButton}" />
</Style>
</ResourceDictionary>