added samples
[windows-sources.git] / sdk / samples / WPFSamples / DrawingBrush / csharp / animategeometrydrawingexample.xaml
blob5e38610321f28c95e474fbd70a32daf8b28c5d08
1 <?xml version="1.0" encoding="Windows-1252"?>
2 <!-- Demonstrates the use of DrawingBrush. -->
3 <Page
4 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6 x:Class="Microsoft.Samples.Graphics.AnimateGeometryDrawingExample"
7 Title="Using a DrawingBrush">
9 <StackPanel>
10 <Border Background="#66000000">
11 <TextBlock Margin="10" HorizontalAlignment="Left" Foreground="White">
12 Animate GeometryDrawing Examples
13 </TextBlock>
14 </Border>
16 <StackPanel Margin="10">
17 <TextBlock>
18 The contents of GeometryDrawing may be animated. In the following example, an EllipseGeometry's RadiusX property is animated.
19 </TextBlock>
21 <StackPanel Orientation="Horizontal">
22 <DockPanel Name="myAnimatedDrawing" Height="400" Width="400">
23 <DockPanel.Background>
24 <DrawingBrush TileMode="FlipXY" Viewport="0,0,100,100" ViewportUnits="Absolute"
25 Viewbox="0,0,1,1" ViewboxUnits="Absolute">
26 <DrawingBrush.Drawing>
27 <GeometryDrawing >
28 <GeometryDrawing.Pen>
29 <Pen Brush="Orange" Thickness="0.1" />
30 </GeometryDrawing.Pen>
31 <GeometryDrawing.Geometry>
32 <EllipseGeometry RadiusX="0.45" RadiusY="0.2" Center="0.5,0.5" />
33 </GeometryDrawing.Geometry>
34 </GeometryDrawing>
35 </DrawingBrush.Drawing>
36 </DrawingBrush>
37 </DockPanel.Background>
38 </DockPanel>
39 </StackPanel>
40 </StackPanel>
41 </StackPanel>
42 <Page.Triggers>
43 <EventTrigger RoutedEvent="Page.Loaded">
44 <BeginStoryboard>
45 <Storyboard>
46 <DoubleAnimation
47 Storyboard.TargetName="myAnimatedDrawing"
48 Storyboard.TargetProperty="(DockPanel.Background).(DrawingBrush.Drawing).(GeometryDrawing.Geometry).(EllipseGeometry.RadiusX)"
49 From="0.01" To="0.5" Duration="0:0:10" AutoReverse="True" RepeatBehavior="Forever" />
50 </Storyboard>
51 </BeginStoryboard>
52 </EventTrigger>
53 </Page.Triggers>
54 </Page>