■ ControlStoryboardAction 엘리먼트 사용하기

----------------------------------------------------------------------------------------------------

Expression Blend 참조 추가

 

 

Microsoft.Expression.Interactions

Microsoft.Expression.Prototyping.Interactivity

System.Windows.Interactivity

 

 

XAML

 

 

<Grid

    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions">

    <Grid.Resources>

        <Storyboard x:Key="StoryboardKey">

            <DoubleAnimation

                Storyboard.TargetName="rectangle"

                Storyboard.TargetProperty="Width"

                Duration="0:0:0.2"

                To="200" />

        </Storyboard>

    </Grid.Resources>

    <Button

        Width="140"

        Height="100"

        Content="ControlStoryboard">

        <i:Interaction.Triggers>

            <i:EventTrigger EventName="Click">

                <ei:ControlStoryboardAction

                    ControlStoryboardOption="Play"

                    Storyboard="{StaticResource StoryboardKey}" />

            </i:EventTrigger>

        </i:Interaction.Triggers>

    </Button>

</Grid>

 

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG

댓글을 달아 주세요