/ Published in: C#
Expand |
Embed | Plain Text
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="562"> <Window.Resources> <Style x:Key="widthAnim" TargetType="{x:Type Button}"> <Style.Triggers> <EventTrigger RoutedEvent="Button.Click"> <BeginStoryboard> <Storyboard Duration="00:05"> <DoubleAnimation AutoReverse="True" Storyboard.TargetProperty="Width" From="100" To="300" /> <ColorAnimation AutoReverse="True" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" To="Red" /> <DoubleAnimation AutoReverse="True" Storyboard.TargetProperty="FontSize" To="24" /> </Storyboard> </BeginStoryboard> </EventTrigger> </Style.Triggers> </Style> </Window.Resources> <Grid> <Button Margin="37,129,30,84" Name="button1" Width="100" Style="{StaticResource widthAnim}">Button</Button> </Grid> </Window>
You need to login to post a comment.
