■ BeginStoryboard 엘리먼트 : Trigger 엘리먼트 EnterActions 속성 및 ExitActions 속성에서 사용하기

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

<StackPanel

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <StackPanel.Resources>

        <Style TargetType="{x:Type Button}">

            <Setter Property="HorizontalAlignment" Value="Center" />

            <Setter Property="FontSize"            Value="12"     />

            <Style.Triggers>

                <Trigger Property="IsMouseOver" Value="True">

                    <Trigger.EnterActions>

                        <BeginStoryboard>

                            <Storyboard>

                                <DoubleAnimation

                                    Storyboard.TargetProperty="FontSize"

                                    Duration="0:0:1"

                                    To="36" />

                            </Storyboard>

                        </BeginStoryboard>

                    </Trigger.EnterActions>

                    <Trigger.ExitActions>

                        <BeginStoryboard>

                            <Storyboard>

                                <DoubleAnimation

                                    Storyboard.TargetProperty="FontSize"

                                    Duration="0:0:0.25"

                                    To="12" />

                            </Storyboard>

                        </BeginStoryboard>

                    </Trigger.ExitActions>

                </Trigger>

            </Style.Triggers>

        </Style>

    </StackPanel.Resources>

    <Button>버튼 1</Button>

    <Button>버튼 2</Button>

    <Button>버튼 3</Button>

    <Button>버튼 4</Button>

    <Button>버튼 5</Button>

</StackPanel>

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

Posted by 사용자 icodebroker