Added source code.
This commit is contained in:
102
Source/Calculator/Styles/Buttons.xaml
Normal file
102
Source/Calculator/Styles/Buttons.xaml
Normal file
@ -0,0 +1,102 @@
|
||||
<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>
|
26
Source/Calculator/Styles/Display.xaml
Normal file
26
Source/Calculator/Styles/Display.xaml
Normal file
@ -0,0 +1,26 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="DisplayStyle" TargetType="{x:Type TextBox}">
|
||||
<Setter Property="TextAlignment" Value="Right"/>
|
||||
<Setter Property="FontFamily" Value="/#Astronaut" />
|
||||
<Setter Property="FontSize" Value="40" />
|
||||
<Setter Property="Foreground" Value="#FFC94A" />
|
||||
<Setter Property="Background" Value="#20FFFFFF" />
|
||||
<Setter Property="BorderBrush" Value="Gray" />
|
||||
<Setter Property="BitmapEffect">
|
||||
<Setter.Value>
|
||||
<DropShadowBitmapEffect Color="Orange"
|
||||
ShadowDepth="1" Opacity=".6"
|
||||
/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DisplayIndicatorStyle" TargetType="{x:Type Border}">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="3,0,3,0" />
|
||||
<Setter Property="CornerRadius" Value="3" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
Reference in New Issue
Block a user