<Window.Resources>

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

<Setter Property="Width" Value="30"/>

<Setter Property="Height" Value="50"/>

<Setter Property="Background" Value="White"/>

<Setter Property="LayoutTransform">

<Setter.Value>

<ScaleTransform CenterX="15" CenterY="25"/>

                           <!--변화시길 기준좌표값-->

</Setter.Value>

</Setter>

 

<Style.Triggers>

<EventTrigger RoutedEvent="Button.MouseEnter">

<BeginStoryboard HandoffBehavior="Compose">

<!--Compose : 개체의 크기가 변할때 다른 개체를 가리지 않도록-->

<Storyboard>

<DoubleAnimation

Storyboard.TargetProperty="LayoutTransform.ScaleX"

Duration="0:0:.5"

From="1" To="2"

FillBehavior="Stop"

AutoReverse="True"/>

 

<DoubleAnimation

Storyboard.TargetProperty="LayoutTransform.ScaleY"

Duration="0:0:.5"

From="1" To="2"

FillBehavior="Stop"

AutoReverse="True"/>

</Storyboard>

</BeginStoryboard>

</EventTrigger>

 

<EventTrigger RoutedEvent="Button.Click">

<BeginStoryboard>

<Storyboard>

<ColorAnimation

Storyboard.TargetProperty="Background.Color"

Duration="0:0:1"

From="White" To="Orange"

FillBehavior="Stop"

AutoReverse="True"/>

</Storyboard>

</BeginStoryboard>

</EventTrigger>

</Style.Triggers>

</Style>

</Window.Resources>

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">

<Button>0</Button>

<Button>1</Button>

<Button>2</Button>

<Button>3</Button>

<Button>4</Button>

<Button>5</Button>

<Button>6</Button>

<Button>7</Button>

<Button>8</Button>

<Button>9</Button>

</StackPanel>



 


by 피요히코~ 2009. 2. 25. 13:10