Animate Button LayoutTransform : Transform « Windows Presentation Foundation « VB.Net






Animate Button LayoutTransform

Animate Button LayoutTransform
     
<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            TextBlock.FontSize="18pt" >

    <UniformGrid Rows="3" Columns="3">
        <Button Content="Button">
            <Button.RenderTransform>
                <RotateTransform x:Name="xform1" />
            </Button.RenderTransform>
        </Button>
    </UniformGrid>

    <UniformGrid Rows="3" Columns="3">
        <Button Content="Button" >
            <Button.LayoutTransform>
                <RotateTransform x:Name="xform2" />
            </Button.LayoutTransform>
        </Button>
        <Button Content="Button" />
    </UniformGrid>

    <StackPanel.Triggers>
        <EventTrigger RoutedEvent="StackPanel.Loaded">
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation Storyboard.TargetName="xform2"
                                     Storyboard.TargetProperty="Angle"
                                     Duration="0:0:10"
                                     From="0" To="360"
                                     RepeatBehavior="Forever" />

                    <DoubleAnimation Storyboard.TargetName="xform1"
                                     Storyboard.TargetProperty="Angle"
                                     Duration="0:0:10"
                                     From="0" To="360"
                                     RepeatBehavior="Forever" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </StackPanel.Triggers>
</StackPanel>

   
    
    
    
    
  








Related examples in the same category

1.RenderTransform sectionRenderTransform section
2.LayoutTransform sectionLayoutTransform section
3.Transformed Buttons with TranslateTransform X/YTransformed Buttons with TranslateTransform X/Y
4.Transformed Buttons with ScaleTransform and ScaleYTransformed Buttons with ScaleTransform and ScaleY
5.Transformed Buttons with SkewTransform and AngleYTransformed Buttons with SkewTransform and AngleY
6.Transformed Buttons with RotateTransform And AngleTransformed Buttons with RotateTransform And Angle
7.Animate Button RenderTransformAnimate Button RenderTransform
8.Translate TransformTranslate Transform
9.ScaleTransformScaleTransform
10.SkewTransform appliedSkewTransform applied
11.Applies a RotateTransform to the brush's Transform propertyApplies a RotateTransform to the brush's Transform property
12.TranslateTransform : LayoutTransform SampleTranslateTransform : LayoutTransform Sample
13.MatrixTransform SampleMatrixTransform Sample
14.Rotate Button Along the center and AngleRotate Button Along the center and Angle
15.Render Tranform
16.Rotate a ButtonRotate a Button
17.Rotate in a circle, then flip, when clickedRotate in a circle, then flip, when clicked
18.RotateTransform AppliedRotateTransform Applied
19.Rotation of content by using RotateTransformRotation of content by using RotateTransform
20.Object Transforms in WPFObject Transforms in WPF