Merge branch 'loaded-branch'
[moon.git] / test / 2.0 / moon-unit / System.Windows / XamlStyle.xaml
blob8668d7c00d8b547b209cb75bc7fecda7a782272d
1 <UserControl x:Class="MoonTest.System.Windows.XamlStyle"
2     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
3     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4     xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
5     <UserControl.Resources>
6         <Style x:Key="ButtonStyle" TargetType="Button">
7             <Setter Property="Template">
8                 <Setter.Value>
9                     <ControlTemplate TargetType="Button">
10                         <Grid>
11                             <vsm:VisualStateManager.VisualStateGroups>
12                                 <vsm:VisualStateGroup>
13                                     <vsm:VisualState x:Name="Normal">
14                                         <Storyboard>
15                                             <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="target" Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)">
16                                                 <SplineColorKeyFrame KeyTime="00:00:00" Value="Black"/>
17                                             </ColorAnimationUsingKeyFrames>
18                                         </Storyboard>
19                                     </vsm:VisualState>
20                                 </vsm:VisualStateGroup>
21                             </vsm:VisualStateManager.VisualStateGroups>
22                             <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}">
23                                 <Rectangle x:Name="target" Height="50" Width="100" Fill="Green"/>
24                             </ContentPresenter>
25                         </Grid>
26                     </ControlTemplate>
27                 </Setter.Value>
28             </Setter>
29         </Style>
30     </UserControl.Resources>
31     <Grid x:Name="LayoutRoot" Background="White">
32         <Button Style="{StaticResource ButtonStyle}" />
33         <TextBlock Text="The rectangle fill should be black, not green" />
34     </Grid>
35 </UserControl>