Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Grid>
- <Label Width="100" Height="50" Background="Tomato" BorderThickness="3" BorderBrush="ForestGreen">
- <Label.Style>
- <Style TargetType="Label">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Border CornerRadius="30" BorderBrush="Transparent" BorderThickness="0" Background="Tomato"></Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Label.Style>
- <Label.RenderTransform>
- <TranslateTransform x:Name="LabelTransform" />
- </Label.RenderTransform>
- <Label.Triggers>
- <EventTrigger RoutedEvent="MouseLeftButtonDown">
- <EventTrigger.Actions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Duration="0:0:1" Storyboard.TargetProperty="Width">
- <LinearDoubleKeyFrame KeyTime="0%" Value="100" />
- <LinearDoubleKeyFrame KeyTime="10%" Value="110" />
- <LinearDoubleKeyFrame KeyTime="20%" Value="120" />
- <LinearDoubleKeyFrame KeyTime="30%" Value="130" />
- <LinearDoubleKeyFrame KeyTime="40%" Value="140" />
- <LinearDoubleKeyFrame KeyTime="50%" Value="150" />
- <LinearDoubleKeyFrame KeyTime="60%" Value="140" />
- <LinearDoubleKeyFrame KeyTime="70%" Value="130" />
- <LinearDoubleKeyFrame KeyTime="80%" Value="120" />
- <LinearDoubleKeyFrame KeyTime="90%" Value="110" />
- <LinearDoubleKeyFrame KeyTime="100%" Value="100" />
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimation Duration="0:0:1" To="100"
- Storyboard.TargetName="LabelTransform"
- Storyboard.TargetProperty="X">
- </DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger.Actions>
- </EventTrigger>
- </Label.Triggers>
- </Label>
- </Grid>
Add Comment
Please, Sign In to add comment