카테고리 없음2010. 10. 25. 15:27
01<Style x:Key="ButtonStyle1" TargetType="Button">
02   <Setter Property="Background" Value="#FF1F3B53"/>
03   <Setter Property="Foreground" Value="#FF000000"/>
04   <Setter Property="Padding" Value="3"/>
05   <Setter Property="BorderThickness" Value="1"/>
06   <Setter Property="BorderBrush">
07      <Setter.Value>
08          <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
09             <GradientStop Color="#FFA3AEB9" Offset="0"/>
10             <GradientStop Color="#FF8399A9" Offset="0.375"/>
11             <GradientStop Color="#FF718597" Offset="0.375"/>
12             <GradientStop Color="#FF617584" Offset="1"/>
13          </LinearGradientBrush>
14       </Setter.Value>
15    </Setter>
16    <Setter Property="Template">
17       <Setter.Value>
18          <ControlTemplate TargetType="Button">
19             <Grid>
20                <VisualStateManager.VisualStateGroups>
21                   <VisualStateGroup x:Name="CommonStates">
22                      <VisualState x:Name="Normal"/>
23                      <VisualState x:Name="MouseOver">
24                         <Storyboard>
25                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverImage"/>
26                         </Storyboard>
27                      </VisualState>
28                      <VisualState x:Name="Pressed">
29                         <Storyboard>
30                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PressedImage"/>
31                         </Storyboard>
32                      </VisualState>
33                      <VisualState x:Name="Disabled" />
34                   </VisualStateGroup>
35                   <VisualStateGroup x:Name="FocusStates">
36                      <VisualState x:Name="Focused" />
37                      <VisualState x:Name="Unfocused" />
38                   </VisualStateGroup>
39                </VisualStateManager.VisualStateGroups>
40                <Border BorderBrush="{TemplateBinding Background}" Background="{TemplateBinding BorderBrush}" BorderThickness="2" />
41                <Rectangle x:Name="NormalImage" Margin="20" Stroke="Red" Fill="Pink" StrokeThickness="2" RadiusX="2" RadiusY="2" Opacity="1"/>
42                <Rectangle x:Name="MouseOverImage" Margin="20" Stroke="Blue" Fill="LightBlue" StrokeThickness="2" RadiusX="2" RadiusY="2" Opacity="0"/>
43                <Rectangle x:Name="PressedImage" Margin="20" Stroke="Green" Fill="YellowGreen" StrokeThickness="2" RadiusX="2" RadiusY="2" Opacity="0"/>
44                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
45             </Grid>
46          </ControlTemplate>
47       </Setter.Value>
48    </Setter>
49</Style>
Posted by metalzone