Created
May 1, 2017 16:36
-
-
Save yazdipour/8f29669832490d806cfa18fe32745a11 to your computer and use it in GitHub Desktop.
circleButtonStyle.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ControlTemplate TargetType="Button"> | |
<Grid x:Name="RootGrid" | |
Background="{TemplateBinding Background}" | |
CornerRadius="100,100,100,100"> | |
<VisualStateManager.VisualStateGroups> | |
<VisualStateGroup x:Name="CommonStates"> | |
<VisualState x:Name="Normal"> | |
<Storyboard> | |
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> | |
</Storyboard> | |
</VisualState> | |
<VisualState x:Name="PointerOver"> | |
<Storyboard> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" | |
Storyboard.TargetName="RootGrid"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonBackgroundPointerOver}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" | |
Storyboard.TargetName="ContentPresenter"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonBorderBrushPointerOver}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" | |
Storyboard.TargetName="ContentPresenter"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonForegroundPointerOver}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<PointerUpThemeAnimation Storyboard.TargetName="RootGrid" /> | |
</Storyboard> | |
</VisualState> | |
<VisualState x:Name="Pressed"> | |
<Storyboard> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" | |
Storyboard.TargetName="RootGrid"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonBackgroundPressed}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" | |
Storyboard.TargetName="ContentPresenter"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonBorderBrushPressed}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" | |
Storyboard.TargetName="ContentPresenter"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonForegroundPressed}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<PointerDownThemeAnimation Storyboard.TargetName="RootGrid" /> | |
</Storyboard> | |
</VisualState> | |
<VisualState x:Name="Disabled"> | |
<Storyboard> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" | |
Storyboard.TargetName="RootGrid"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonBackgroundDisabled}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" | |
Storyboard.TargetName="ContentPresenter"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonBorderBrushDisabled}" /> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" | |
Storyboard.TargetName="ContentPresenter"> | |
<DiscreteObjectKeyFrame KeyTime="0" | |
Value="{ThemeResource ButtonForegroundDisabled}" /> | |
</ObjectAnimationUsingKeyFrames> | |
</Storyboard> | |
</VisualState> | |
</VisualStateGroup> | |
</VisualStateManager.VisualStateGroups> | |
<ContentPresenter x:Name="ContentPresenter" | |
AutomationProperties.AccessibilityView="Raw" | |
BorderBrush="{TemplateBinding BorderBrush}" | |
BorderThickness="{TemplateBinding BorderThickness}" | |
ContentTemplate="{TemplateBinding ContentTemplate}" | |
ContentTransitions="{TemplateBinding ContentTransitions}" | |
Content="{TemplateBinding Content}" | |
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" | |
Padding="{TemplateBinding Padding}" | |
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" | |
CornerRadius="100,100,100,100"/> | |
</Grid> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment