<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <!--Create a control template for button--> <ControlTemplate x:Key="buttonAnimate" TargetType="Button"> <Grid Name="myGrid"> <Button Name="myButton" Background="{TemplateBinding Background }" Width="{TemplateBinding Width}"> </Button> <Border Name="MyBorder" BorderBrush="Orange" BorderThickness="3" CornerRadius="2"></Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="DarkRed" TargetName="MyBorder"/> <Setter Property="Width" Value="200" TargetName="myButton"/> <Setter Property="Cursor" Value="Hand" TargetName="myGrid"/> <Setter Property="Width" Value="300" TargetName="myButton"/> <Setter Property="Width" Value="300" TargetName="MyBorder"/> <Setter Property="Padding" Value="2" TargetName="myButton"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </ResourceDictionary>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)