1 <?xml version=
"1.0" encoding=
"Windows-1252"?>
2 <!-- Demonstrates the use of DrawingBrush. -->
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">
10 <Border Background=
"#66000000">
11 <TextBlock Margin=
"10" HorizontalAlignment=
"Left" Foreground=
"White">
12 Animate GeometryDrawing Examples
16 <StackPanel Margin=
"10">
18 The contents of GeometryDrawing may be animated. In the following example, an EllipseGeometry's RadiusX property is animated.
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
>
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
>
35 </DrawingBrush.Drawing
>
37 </DockPanel.Background
>
43 <EventTrigger RoutedEvent=
"Page.Loaded">
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" />