<Page x:Class="WpfInteropShortcomings.Animation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Animation"
    xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" 
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 
    VerticalAlignment="Top" Width="350" Height="350"
    >
    <Grid Margin="2">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition />
      </Grid.RowDefinitions>


      <Rectangle Grid.ColumnSpan="2">
        <Rectangle.Fill>
          <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="Gray" Offset="0" />
            <GradientStop Color="White" Offset="0.5" />
            <GradientStop Color="Gray" Offset="1" />
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <TextBlock FontSize="80" VerticalAlignment="Center">
        WPF<LineBreak />
        WPF<LineBreak />
        WPF
      </TextBlock>


      <wfi:WindowsFormsHost FontSize="30" FontWeight="Bold"   Grid.Column="1" Margin="0,20,0,0" VerticalAlignment="Top" Height="82" Background="LightGray">
        <wf:Label TextAlign="MiddleCenter"  Text="Windows Forms" />
      </wfi:WindowsFormsHost>

      <wfi:WindowsFormsHost FontSize="30" FontWeight="Bold"   Grid.Column="1" Margin="0,128,0,0" VerticalAlignment="Top" Height="82" Background="LightGray">
        <wf:Label TextAlign="MiddleCenter"  Text="Windows Forms" />
      </wfi:WindowsFormsHost>
      <wfi:WindowsFormsHost FontSize="30" FontWeight="Bold"   Grid.Column="1" Margin="0,235,0,0" VerticalAlignment="Top" Height="82" Background="LightGray">
        <wf:Label TextAlign="MiddleCenter"  Text="Windows Forms" />
      </wfi:WindowsFormsHost>

      <Ellipse x:Name="ball"  Fill="Blue" Width="80" Height="80" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0">
        <Ellipse.RenderTransform>
          <RotateTransform Angle="0" CenterX="161" CenterY="40" />
        </Ellipse.RenderTransform>
        <Ellipse.Triggers>
          <EventTrigger RoutedEvent="Ellipse.Loaded">
            <BeginStoryboard>
              <Storyboard TargetProperty="(Ellipse.RenderTransform).(RotateTransform.Angle)">
                <DoubleAnimation From="0" To="360" Duration="0:1:0" RepeatBehavior="Forever"/>
              </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
        </Ellipse.Triggers>
      </Ellipse>
    </Grid>
</Page>
