You may have discovered that no matter what type of animation, the method of use is basically the same. I don't know if you have summed up the rule? When you find the rule, you will find that the rule can be used for the first to sixth, not to lie to you.
To help you find the rule, let's write two more examples today.
I. discreteobjectkeyframe
This is a brief introduction. It is provided to facilitate some large switchover, but it is not omnipotent. Although its target type is object type, the premise is that, like other animations, an animation can only process a certain attribute of an object. Compared with flash, Silverlight is less flexible, but we know that after all, Silverlight was not born for animation purposes. Microsoft launched it for enterprise-level applications. The so-called multimedia support or animation is to provide a better user experience. Do not treat it as a special entertainment.
Well, let's talk about F. Let's start the exercises below. First, you can refer to the following XAMLCodeComplete the layout at the front-end, wherever you want, you can find the grid control as a container. The exercises are also flexible, and I will never have the requirement for hard work.
<Path Grid.Column = "0" Grid.Row = "0">
<Path.Data>
<LineGeometry StartPoint = "20,5" EndPoint = "200,320" />
</Path.Data>
</ Path>
A
After running, you will see the following scenario:
A
A
A
A
Second, RectangleGeometry
It presents a person 's rectangular geometry. Rect indicates the position and size of the rectangle. In XAML, it can be represented by 4 values, namely X, Y, Width, and Height; otherwise, RadiusX and RadiusY indicate rounded corners on the X and Y axes. On the radius. See the example below.
<Path Grid.Column = "1" Grid.Row = "0">
<Path.Data>
RectangleGeometry Rect = "12,6,125,90" RadiusX = "24" RadiusY = "30" />
</Path.Data>
</ Path>
The running effect is as shown.
A
A
A
A
3. EllipseGeometry
A
Represents the geometry of an ellipse, the Center property is the coordinates of the center point of the ellipse, RadiusX and RadiusY are the radius length in the X-axis direction and the Y-axis direction, respectively. See examples.
<Path Grid.Column = "0" Grid.Row = "1">
<Path.Data>
<EllipseGeometry Center = "100,180" RadiusX = "55" RadiusY = "120" />
</Path.Data>
</ Path>
A
The running effect is as follows:
A
A
A
Four, GeometryGroup
A
Strictly speaking, it does not attribute a geometric figure, but it is very useful because it can contain N geometric figures at the same time, as shown in the following example.
<Path Grid.Column = "1" Grid.Row = "1">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint = "32,185" EndPoint = "180,230" />
RectangleGeometry Rect = "35,85,136,96" RadiusX = "25" RadiusY = "5" />
<EllipseGeometry Center = "112,130" RadiusX = "45" RadiusY = "36" />
</ GeometryGroup>
</Path.Data>
</ Path>
The operating effect is as follows:
A
A
A
Below is the complete XAML code for the example in this section.
<phone: PhoneApplicationPage
X: Class = "Sample.MainPage"
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Xmlns: phone = "clr-namespace: Microsoft.Phone.Controls; assembly = Microsoft.Phone"
Xmlns: shell = "clr-namespace: Microsoft.Phone.Shell; assembly = Microsoft.Phone"
Xmlns: d = "http://schemas.microsoft.com/expression/blend/2008"
Xmlns: mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"
Mc: Ignorable = "d" d: DesignWidth = "480" d: DesignHeight = "768"
FontFamily = "{StaticResource PhoneFontFamilyNormal}"
FontSize = "{StaticResource PhoneFontSizeNormal}"
Foreground = "{StaticResource PhoneForegroundBrush}"
SupportedOrientations = "Portrait" Orientation = "Portrait"
Shell: SystemTray.IsVisible = "True">
<Phone: PhoneApplicationPage.Resources>
<Style TargetType = "Path">
<Setter Property = "HorizontalAlignment" Value = "Stretch" />
<Setter Property = "VerticalAlignment" Value = "Stretch" />
<Setter Property = "Margin" Value = "20" />
<Setter Property = "Stroke" Value = "Blue" />
<Setter Property = "StrokeThickness" Value = "8" />
</ Style>
</Phone:PhoneApplicationPage.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width = "*" />
<ColumnDefinition Width = "*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height = "*" />
<RowDefinition Height = "*" />
</Grid.RowDefinitions>
<Path Grid.Column = "0" Grid.Row = "0">
<Path.Data>
<LineGeometry StartPoint = "20,5" EndPoint = "200,320" />
</Path.Data>
</ Path>
<Path Grid.Column = "1" Grid.Row = "0">
<Path.Data>
<RectangleGeometry Rect = "12,6,125,90" RadiusX = "24" RadiusY = "30" />
</Path.Data>
</ Path>
<Path Grid.Column = "0" Grid.Row = "1">
<Path.Data>
<EllipseGeometry Center = "100,180" RadiusX = "55" RadiusY = "120" />
</Path.Data>
</ Path>
<Path Grid.Column = "1" Grid.Row = "1">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint = "32,185" EndPoint = "180,230" />
<RectangleGeometry Rect = "35,85,136,96" RadiusX = "25" RadiusY = "5" />
<EllipseGeometry Center = "112,130" RadiusX = "45" RadiusY = "36" />
</ GeometryGroup>
</Path.Data>
</ Path>
</ Grid>
</ phone: PhoneApplicationPage>