Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Image-Togglebutton Animation
- <Button Height="53" HorizontalAlignment="Left" IsEnabled="True" IsHitTestVisible="True" Margin="23,294,0,0" Name="ok_button" VerticalAlignment="Top" Width="128">
- <Button.Template>
- <ControlTemplate TargetType="{x:Type Button}">
- <ControlTemplate.Resources>
- <Storyboard x:Key="MouseDownTimeLine">
- <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Pressed" Storyboard.TargetProperty="Opacity">
- <SplineDoubleKeyFrame KeyTime="00:00:00.05" Value="1" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- <Storyboard x:Key="MouseUpTimeLine">
- <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Pressed" Storyboard.TargetProperty="Opacity">
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- <Storyboard x:Key="MouseEnterTimeLine">
- <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity">
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- <Storyboard x:Key="MouseExitTimeLine">
- <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity">
- <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0" />
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </ControlTemplate.Resources>
- <Grid>
- <Image Name="Normal" Source="/Specter;component/Images/ok_btn_n.png" />
- <Image Name="Hover" Opacity="0" Source="/Specter;component/Images/ok_btn_h.png" />
- <Image Name="Pressed" Opacity="0" Source="/Specter;component/Images/ok_btn_p.png" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="ButtonBase.IsPressed" Value="True">
- <Trigger.EnterActions>
- <BeginStoryboard Storyboard="{StaticResource MouseDownTimeLine}" />
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard Storyboard="{StaticResource MouseUpTimeLine}" />
- </Trigger.ExitActions>
- </Trigger>
- <Trigger Property="UIElement.IsMouseOver" Value="True">
- <Trigger.EnterActions>
- <BeginStoryboard Storyboard="{StaticResource MouseEnterTimeLine}" />
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard Storyboard="{StaticResource MouseExitTimeLine}" />
- </Trigger.ExitActions>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
Add Comment
Please, Sign In to add comment