Posted By

qrist0ph on 08/26/08


Tagged

WPF studentWest xaml


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


WPF Animations


 / Published in: XML
 

  1. <Window x:Class="WpfApplication3.Window1"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="Window1" Height="300" Width="500">
  5. <Window.Resources>
  6. <Style x:Key="widthAnim" TargetType="{x:Type Button}" >
  7. <Style.Triggers>
  8. <EventTrigger RoutedEvent="Button.Click" >
  9. <BeginStoryboard >
  10. <Storyboard Duration="00:05">
  11. <DoubleAnimation AutoReverse="True" Storyboard.TargetProperty="Width" From="100" To="300" />
  12. <ColorAnimation AutoReverse="True" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
  13. To="Red" />
  14. </Storyboard>
  15. </BeginStoryboard>
  16. </EventTrigger>
  17. </Style.Triggers>
  18. </Style>
  19.  
  20. </Window.Resources>
  21. <Grid>
  22.  
  23. <Button Margin="188,117,186,122" Name="button1" Style="{StaticResource widthAnim}" >Button</Button>
  24. </Grid>
  25. </Window>

Report this snippet  

You need to login to post a comment.